blob: e42ed0d5c58331ff5f8fd84b8dc30eadefc97d55 [file] [log] [blame]
diff -ur aview-1.3.0-orig/asciiview aview-1.3.0/asciiview
--- aview-1.3.0-orig/asciiview 2005-08-15 21:20:16.000000000 -0400
+++ aview-1.3.0/asciiview 2005-08-15 21:20:19.000000000 -0400
@@ -7,9 +7,9 @@
}
myconvert()
{
- if anytopnm $1 >/tmp/aview$$.pgm 2>/dev/null ; then
+ if anytopnm "$1" >/tmp/aview$$.pgm 2>/dev/null ; then
exit
- elif convert -colorspace gray $1 pgm:- 2>/dev/null ; then
+ elif convert -colorspace gray "$1" pgm:- 2>/dev/null ; then
exit
fi
echo "Failed to convert file format to PNM by both convert and anytopnm" >&2
@@ -44,8 +44,13 @@
options="$options $1"
shift
;;
- *)
- filenames="$filenames $1"
+ *)
+ if [ "$filenames" = "" ]
+ then
+ filenames=$1 #avoid leading null
+ else
+ filenames=$(echo -e "$filenames\000$1")
+ fi
shift
;;
esac
@@ -53,15 +58,16 @@
trap clear 0
mkfifo /tmp/aview$$.pgm
outfile=/tmp/aview$$.pgm
-for name in $filenames ; do
-if test -r $name ; then
-case $name in
+IFS=$(echo -e "\000")
+echo $filenames | while read name; do
+if test -r "$name" ; then
+case "$name" in
*.fli | *.lfc | *.flic )
PATH="$PATH:."
- aaflip $options $name
+ aaflip $options "$name"
;;
*)
- myconvert $name >/tmp/aview$$.pgm &
+ myconvert "$name" >/tmp/aview$$.pgm &
pid=$!
PATH="$PATH:."
aview $options /tmp/aview$$.pgm