]> git.pld-linux.org Git - packages/aview.git/blame - asciiview-lame_bashizm.patch
- dropped pre-cvs changelog
[packages/aview.git] / asciiview-lame_bashizm.patch
CommitLineData
a0888e48
TP
1--- asciiview 2001-04-25 17:59:22.000000000 +0200
2+++ /usr/bin/asciiview 2010-03-07 18:58:25.000000000 +0100
3@@ -1,4 +1,4 @@
4-#!/bin/bash
5+#!/bin/sh
6 # asciiview - an ascii art image browser script. Front end for aview/aaflip
7 clear()
8 {
9@@ -7,9 +7,9 @@
10 }
11 myconvert()
12 {
13- if anytopnm $1 >/tmp/aview$$.pgm 2>/dev/null ; then
14+ if anytopnm "$1" >/tmp/aview$$.pgm 2>/dev/null; then
15 exit
16- elif convert -colorspace gray $1 pgm:- 2>/dev/null ; then
17+ elif convert -colorspace gray "$1" pgm:- 2>/dev/null; then
18 exit
19 fi
20 echo "Failed to convert file format to PNM by both convert and anytopnm" >&2
21@@ -17,7 +17,7 @@
22 echo "0 "
23 done
24 }
25-filenames=""
26+set -A filenames
27 options=""
28 if [ "$1" = "" ]; then
29 echo "$0 - an ascii art image/animation browser.
30@@ -45,29 +45,30 @@
31 shift
32 ;;
33 *)
34- filenames="$filenames $1"
35+ filenames[${#filenames[@]}]="$1"
36 shift
37 ;;
38 esac
39 done
40-trap clear 0
41+trap clear 0 2 3 9 15
42 mkfifo /tmp/aview$$.pgm
43-outfile=/tmp/aview$$.pgm
44-for name in $filenames ; do
45-if test -r $name ; then
46-case $name in
47+i=0
48+while [ $i -lt ${#filenames[@]} ]; do
49+ name=${filenames[$i]}
50+ if [ -r "$name" ]; then
51+ case "$name" in
52 *.fli | *.lfc | *.flic )
53 PATH="$PATH:."
54- aaflip $options $name
55+ aaflip $options "$name"
56 ;;
57 *)
58- myconvert $name >/tmp/aview$$.pgm &
59+ myconvert "$name" > /tmp/aview$$.pgm &
60 pid=$!
61- PATH="$PATH:."
62 aview $options /tmp/aview$$.pgm
63 kill $pid 2>/dev/null
64 esac
65 else
66 echo "$name could not be opended"
67 fi
68+ i=$((i+1))
69 done
This page took 0.079324 seconds and 4 git commands to generate.