mirror of
git://sourceware.org/git/bzip2.git
synced 2024-11-23 11:43:28 +08:00
fix bzdiff when TMPDIR contains spaces
The bzdiff script doesn't contain enough quotes, so that it doesn't work if the TMPDIR environment variable is defined and contains spaces. https://bugs.debian.org/493710 Author: Vincent Lefevre <vincent@vinc17.org>
This commit is contained in:
parent
d50cc4b0e7
commit
f7d209bfde
16
bzdiff
Normal file → Executable file
16
bzdiff
Normal file → Executable file
@ -37,10 +37,6 @@ if test -z "$FILES"; then
|
|||||||
echo "Usage: $prog [${comp}_options] file [file]"
|
echo "Usage: $prog [${comp}_options] file [file]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
tmp=`mktemp ${TMPDIR:-/tmp}/bzdiff.XXXXXXXXXX` || {
|
|
||||||
echo 'cannot create a temporary file' >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
set $FILES
|
set $FILES
|
||||||
if test $# -eq 1; then
|
if test $# -eq 1; then
|
||||||
FILE=`echo "$1" | sed 's/.bz2$//'`
|
FILE=`echo "$1" | sed 's/.bz2$//'`
|
||||||
@ -53,10 +49,14 @@ elif test $# -eq 2; then
|
|||||||
case "$2" in
|
case "$2" in
|
||||||
*.bz2)
|
*.bz2)
|
||||||
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
|
F=`echo "$2" | sed 's|.*/||;s|.bz2$||'`
|
||||||
bzip2 -cdfq "$2" > $tmp
|
tmp=`mktemp "${TMPDIR:-/tmp}"/bzdiff.XXXXXXXXXX` || {
|
||||||
bzip2 -cdfq "$1" | $comp $OPTIONS - $tmp
|
echo 'cannot create a temporary file' >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
bzip2 -cdfq "$2" > "$tmp"
|
||||||
|
bzip2 -cdfq "$1" | $comp $OPTIONS - "$tmp"
|
||||||
STAT="$?"
|
STAT="$?"
|
||||||
/bin/rm -f $tmp;;
|
/bin/rm -f "$tmp";;
|
||||||
|
|
||||||
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
|
*) bzip2 -cdfq "$1" | $comp $OPTIONS - "$2"
|
||||||
STAT="$?";;
|
STAT="$?";;
|
||||||
@ -69,8 +69,8 @@ elif test $# -eq 2; then
|
|||||||
STAT="$?";;
|
STAT="$?";;
|
||||||
esac;;
|
esac;;
|
||||||
esac
|
esac
|
||||||
exit "$STAT"
|
|
||||||
else
|
else
|
||||||
echo "Usage: $prog [${comp}_options] file [file]"
|
echo "Usage: $prog [${comp}_options] file [file]"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
exit "$STAT"
|
||||||
|
Loading…
Reference in New Issue
Block a user