ylwrap: refactor: move loop invariant
authorAkim Demaille <akim@lrde.epita.fr>
Sat, 14 Jul 2012 08:09:15 +0000 (10:09 +0200)
committerAkim Demaille <akim@lrde.epita.fr>
Sat, 14 Jul 2012 14:57:32 +0000 (16:57 +0200)
* lib/ylwrap (input_rx): Move its definition next to its sibling's,
outside of the main loop.

lib/ylwrap

index d245ba0..30e8a6c 100755 (executable)
@@ -108,6 +108,7 @@ case "$input" in
     input="`pwd`/$input"
     ;;
 esac
+input_rx=`get_dirname "$input" | quote_for_sed`
 
 # Since DOS filename conventions don't allow two dots,
 # the DOS version of Bison writes out y_tab.c instead of y.tab.c
@@ -176,9 +177,6 @@ ret=$?
 if test $ret -eq 0; then
   set X $pairlist
   shift
-
-  input_rx=`get_dirname "$input" | quote_for_sed`
-
   while test "$#" -ne 0; do
     from=$1
     to=$2