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

Bug#127353: xdvi wrapper script fails with spaces in options



Package: tetex-bin
Version: 1.0.7+20011202-2
Severity: normal

When using xdvi's -sourceposition option in conjunction with a file
name which starts with a digit, the line number has to be separated
from the file name with a space and the whole expression needs to be
enclosed in quotes (or the space needs to be escaped) to prevent the
shell from breaking it up into two arguments, e.g.:

	xdvi -sourceposition "143 00file.tex" 00file.dvi
	xdvi -sourceposition 143\ 00file.tex  00file.dvi

The wrapper script /usr/bin/xdvi, however, does not deal with spaces
in options properly. They are broken up into separate arguments,
making xdvi quit with an error message in this particular case.

I suggest changing the /usr/bin/xdvi wrapper script along the
following lines:

---------- BEGIN xdvi.diff ----------
49c49
< for i in "$@"
---
> for i
52c52
<     lastarg="\"$i\""
---
>     lastarg=$i
74c74
< eval xdvi.bin $NAMEOPT $args $filename || exit 1
---
> xdvi.bin $NAMEOPT $args $filename || exit 1
----------  END  xdvi.diff ----------

-- 
Philipp Lehman  <lehman@gmx.net>




Reply to: