automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {ylwrap-refactor} ylwrap: another cleanup refactoring (no semantic


From: Stefano Lattarini
Subject: [FYI] {ylwrap-refactor} ylwrap: another cleanup refactoring (no semantic change)
Date: Thu, 5 May 2011 19:32:29 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* lib/ylwrap: Restructure main code to remove an if/else
construct.
---
 ChangeLog  |    6 ++++++
 lib/ylwrap |   30 +++++++++++++-----------------
 2 files changed, 19 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 264c5fe..78d7ffa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2011-05-05  Stefano Lattarini  <address@hidden>
 
+       ylwrap: another cleanup refactoring (no semantic change)
+       * lib/ylwrap: Restructure main code to remove an if/else
+       construct.
+
+2011-05-05  Stefano Lattarini  <address@hidden>
+
        ylwrap: cleanup refactoring  (no semantic change)
        * lib/ylwrap (handle_renaming): Restructure to remove a longish
        if/else construct.
diff --git a/lib/ylwrap b/lib/ylwrap
index dfff700..fbbca84 100755
--- a/lib/ylwrap
+++ b/lib/ylwrap
@@ -271,27 +271,23 @@ case $# in
 esac
 ret=$?
 
-if test $ret -eq 0; then
+test $ret -eq 0 || eval "$do_exit"
 
-  set X $pairlist
-  shift
-
-  # The directory holding the input.
-  input_dir=`dirname_ "$input"`
-  # Quote $input_dir so we can use it in a regexp.
-  input_rx=`quote_for_sed "$input_dir"`
+set X $pairlist
+shift
 
-  while test $# -ne 0; do
-    handle_renaming "$1" "$2"
-    shift
-    shift
-  done
-fi
+# The directory holding the input.
+input_dir=`dirname_ "$input"`
+# Quote $input_dir so we can use it in a regexp.
+input_rx=`quote_for_sed "$input_dir"`
 
-# Remove the temporary directory.
-cd "$ocwd" && rm -rf $dirname
+while test $# -ne 0; do
+  handle_renaming "$1" "$2"
+  shift
+  shift
+done
 
-exit $ret
+eval "$do_exit"
 
 # Local Variables:
 # mode: shell-script
-- 
1.7.2.3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]