]> git.gag.com Git - debian/gzip/commitdiff
* zdiff.in (cmp0): New var.
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jan 2007 08:03:20 +0000 (08:03 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 4 Jan 2007 08:03:20 +0000 (08:03 +0000)
Rewrite test for /dev/fd/3 to detect bugs in Solaris 8
/bin/bash 2.03.  Problem reported by Nelson H. F. Beebe in
<http://lists.gnu.org/archive/html/bug-gzip/2007-01/msg00001.html>.
Avoid "for file; do", which doesn't work with Solaris 8 /bin/sh.

ChangeLog
zdiff.in

index b7699b0518e4d2c4a1fe982837ab319caa257118..2f62ed2386d0117f18a398609752b477773f748d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * zdiff.in (cmp0): New var.
+       Rewrite test for /dev/fd/3 to detect bugs in Solaris 8
+       /bin/bash 2.03.  Problem reported by Nelson H. F. Beebe in
+       <http://lists.gnu.org/archive/html/bug-gzip/2007-01/msg00001.html>.
+       Avoid "for file; do", which doesn't work with Solaris 8 /bin/sh.
+
 2007-01-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        * zdiff.in: Test /dev//fd/3, not /dev/fd/3, to work around a problem
index 72caacc2fe62eca8c9c6dd4c5184585b8808c190..b17eafcd062ee904790a3db86f6e2b3883f34393 100644 (file)
--- a/zdiff.in
+++ b/zdiff.in
@@ -14,6 +14,7 @@ case "$0" in
   *cmp) prog=cmp ; cmp='${CMP-cmp}'  ;;
   *)    prog=diff; cmp='${DIFF-diff}';;
 esac
+cmp0=$cmp
 
 version="z$prog (gzip) @VERSION@
 Copyright (C) 2006 Free Software Foundation, Inc.
@@ -45,7 +46,8 @@ while :; do
 done
 cmp="$cmp --"
 
-for file; do
+for file
+do
   test "X$file" = X- || <"$file" || exit 2
 done
 
@@ -65,9 +67,12 @@ elif test $# -eq 2; then
                *[-.]gz* | *[-.][zZ] | *.t[ga]z | -)
                    if test "$1$2" = --; then
                        gzip -cdfq - | eval "$cmp" - -
-                   # The extra slash in /dev//fd works around a problem with
-                   # Tru64 4.0F ksh M-11/16/88f.
-                   elif test -r /dev//fd/3 3</dev/null; then
+                   elif
+                       # Reject Solaris 8's buggy /bin/bash 2.03.
+                       echo X |
+                        (echo X | eval "$cmp0" /dev/fd/3 - >/dev/null 2>&1) \
+                               3<&0
+                   then
                        gzip -cdfq -- "$1" |
                          (gzip -cdfq -- "$2" |
                           eval "$cmp" /dev/fd/3 -) 3<&0