aboutsummaryrefslogtreecommitdiff
path: root/src/scripts
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-07-31 11:01:47 +0300
committerLasse Collin <lasse.collin@tukaani.org>2011-09-05 16:05:44 +0300
commit2c144a0365c84dbf1b6722466746d42f2563a319 (patch)
tree83873027a42f31706cf7a715eacc492f69bdd5b5 /src/scripts
parentadd build script for macosx universal (diff)
downloadxz-2c144a0365c84dbf1b6722466746d42f2563a319.tar.xz
Fix exit status of "xzdiff foo.xz bar.xz".
xzdiff was clobbering the exit status from diff in a case statement used to analyze the exit statuses from "xz" when its operands were two compressed files. Save and restore diff's exit status to fix this. The bug is inherited from zdiff in GNU gzip and was fixed there on 2009-10-09. Thanks to Jonathan Nieder for the patch and to Peter Pallinger for reporting the bug.
Diffstat (limited to 'src/scripts')
-rw-r--r--src/scripts/xzdiff.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/scripts/xzdiff.in b/src/scripts/xzdiff.in
index 45633e0a..deec3ebf 100644
--- a/src/scripts/xzdiff.in
+++ b/src/scripts/xzdiff.in
@@ -120,10 +120,12 @@ elif test $# -eq 2; then
( ($xz2 -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
eval "$cmp" /dev/fd/5 - >&3) 5<&0
)
+ cmp_status=$?
case $xz_status in
*[1-9]*) xz_status=1;;
*) xz_status=0;;
esac
+ (exit $cmp_status)
else
F=`expr "/$2" : '.*/\(.*\)[-.][ablmtxz2]*$'` || F=$prog
tmp=