aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]bzdiff16
1 files changed, 8 insertions, 8 deletions
diff --git a/bzdiff b/bzdiff
index 6fc38f9..bd96c27 100644..100755
--- a/bzdiff
+++ b/bzdiff
@@ -37,10 +37,6 @@ if test -z "$FILES"; then
37 echo "Usage: $prog [${comp}_options] file [file]" 37 echo "Usage: $prog [${comp}_options] file [file]"
38 exit 1 38 exit 1
39fi 39fi
40tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
41 echo 'cannot create a temporary file' >&2
42 exit 1
43}
44set $FILES 40set $FILES
45if test $# -eq 1; then 41if test $# -eq 1; then
46 FILE=`echo "$1" | sed 's/.bz2$//'` 42 FILE=`echo "$1" | sed 's/.bz2$//'`
@@ -53,10 +49,14 @@ elif test $# -eq 2; then
53 case "$2" in 49 case "$2" in
54 *.bz2) 50 *.bz2)
55 F=`echo "$2" | sed 's|.*/||;s|.bz2$||'` 51 F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
56 bzip2 -cdfq "$2" > $tmp 52 tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
57 bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp 53 echo 'cannot create a temporary file' >&2
54 exit 1
55 }
56 bzip2 -cdfq "$2" > "$tmp"
57 bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
58 STAT="$?" 58 STAT="$?"
59 /bin/rm -f $tmp;; 59 /bin/rm -f "$tmp";;
60 60
61 *) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2" 61 *) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
62 STAT="$?";; 62 STAT="$?";;
@@ -69,8 +69,8 @@ elif test $# -eq 2; then
69 STAT="$?";; 69 STAT="$?";;
70 esac;; 70 esac;;
71 esac 71 esac
72 exit "$STAT"
73else 72else
74 echo "Usage: $prog [${comp}_options] file [file]" 73 echo "Usage: $prog [${comp}_options] file [file]"
75 exit 1 74 exit 1
76fi 75fi
76exit "$STAT"