zdiff: fix malfunction when operating on two gzip'd inputs
authorJim Meyering <meyering@redhat.com>
Fri, 9 Oct 2009 10:28:56 +0000 (12:28 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 9 Oct 2009 10:37:57 +0000 (12:37 +0200)
zdiff would fail to print differences in two compressed inputs
* zdiff.in: Don't let cmp output mix with echo'd gzip exit
status values.  Report and fix from Jörg-Volker Peetz via
<http://bugs.debian.org/434275>
* NEWS (Bug fixes): Mention it.

NEWS
THANKS
zdiff.in

diff --git a/NEWS b/NEWS
index c5feb81117197911e82b07704ec38c2d82cde0b2..ec39a4cb45710bae7c2e82ffdb6cb9e1be97ab83 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ GNU gzip NEWS                                    -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
 
+** Bug fixes
+
+  zdiff would fail to print differences in two compressed inputs
+
 
 * Noteworthy changes in release 1.3.13 (2009-09-30) [stable]
 
diff --git a/THANKS b/THANKS
index c7fd00bede6154946a19738555f7c066fb1b4d84..47255436db3b4c08cc04b2d2e19c39485131f5fa 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -195,6 +195,7 @@ Arthur David Olson      ado@elsie.nci.nih.gov
 Piet van Oostrum        piet@cs.ruu.nl
 Rafael R. Pappalardo    rafapa@obelix.cica.es
 Mike Pearlman           canuck@masc38.rice.edu
+Jörg-Volker Peetz       peetz@dynato-kyma.net
 Yves Perrenoud          pyves@nuga.alphanet.ch
 Hal Peterson            hrp@pecan.cray.com
 Pascal Petit            petit@cadillac.ibp.fr
index 98188542b6e17871204f794fb22f6463d1471b8e..2a15860d424bc7bb6e659d5ac784d21c14332187 100644 (file)
--- a/zdiff.in
+++ b/zdiff.in
@@ -1,7 +1,7 @@
 #!/bin/sh
 # sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
 
-# Copyright (C) 1998, 2002, 2006, 2007 Free Software Foundation
+# Copyright (C) 1998, 2002, 2006, 2007, 2009 Free Software Foundation
 # Copyright (C) 1993 Jean-loup Gailly
 
 # This program is free software; you can redistribute it and/or modify
@@ -108,7 +108,7 @@ elif test $# -eq 2; then
                          exec 4>&1
                          (gzip -cdfq -- "$1" 4>&-; echo $? >&4) 3>&- |
                            ( (gzip -cdfq -- "$2" 4>&-; echo $? >&4) 3>&- 5<&- </dev/null |
-                              eval "$cmp" /dev/fd/5 -) 5<&0
+                              eval "$cmp" /dev/fd/5 - >&3) 5<&0
                        )
                        case $gzip_status in
                          *[1-9]*) gzip_status=1;;