* 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 <stefano.lattar...@gmail.com> + ylwrap: another cleanup refactoring (no semantic change) + * lib/ylwrap: Restructure main code to remove an if/else + construct. + +2011-05-05 Stefano Lattarini <stefano.lattar...@gmail.com> + 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