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

Bug#117528: xdvi no longer understands quotes in options



Since this bug is still open a year later I assume there was something wrong
with the previously submitted patches.  Here's a different patch to fix the
problem; this one uses eval to avoid messing with IFS.  This is against the
xdvi in Woody (tetex-bin 1.0.7+20011202)

--- /usr/bin/xdvi       Fri Apr 26 22:05:22 2002
+++ /home/al/bin/xdvi   Thu Sep 12 14:43:46 2002
@@ -45,14 +45,16 @@
   XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH
 fi
 
-#exec xdvi.bin $NAMEOPT ${1+"$@"}
-for i
+# put the last argument into $filename
+eval filename=\"\$$#\"
+# leave all but the last argument in $@
+i=1; while test $i -lt $#
 do
-    args="$args $lastarg"
-    lastarg=$i
+  str="$str '\$$i'"
+  i=$(($i + 1))
 done
-filename=$lastarg
-#filename=${1+"$#"}
+eval eval set -- \"$str\"
+
 compress=0
 case "${filename}X" in
   *.gzX|*.ZX)
@@ -72,10 +74,7 @@
 fi
 
 if test $filename; then
-    exec xdvi.bin $NAMEOPT $args "$filename" || exit 1
+    exec xdvi.bin $NAMEOPT "$@" "$filename" || exit 1
 else
-    exec xdvi.bin $NAMEOPT $args || exit 1
+    exec xdvi.bin $NAMEOPT "$@" || exit 1
 fi
-
-#xdvi.bin $NAMEOPT $args "$filename" || exit 1
-#exit 0


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com



Reply to: