From 6fb1dc428b25ededa4a993ad080ce65dbdfca73c Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 4 Jan 2007 08:03:20 +0000 Subject: [PATCH] * 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 . Avoid "for file; do", which doesn't work with Solaris 8 /bin/sh. --- ChangeLog | 8 ++++++++ zdiff.in | 13 +++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7699b0..2f62ed2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-04 Paul Eggert + + * 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 + . + Avoid "for file; do", which doesn't work with Solaris 8 /bin/sh. + 2007-01-03 Paul Eggert * zdiff.in: Test /dev//fd/3, not /dev/fd/3, to work around a problem diff --git a/zdiff.in b/zdiff.in index 72caacc..b17eafc 100644 --- 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 2>&1) \ + 3<&0 + then gzip -cdfq -- "$1" | (gzip -cdfq -- "$2" | eval "$cmp" /dev/fd/3 -) 3<&0 -- 2.47.2