tests: redo patch for non-GNU gzip installed in /usr/local/bin
[debian/gzip] / zgrep.in
index 68396dbfcbbbf8de623d53c5aa77b5c11f993e89..154d17f4cea73a20179fdcb86a014fc670a9a465 100644 (file)
--- a/zgrep.in
+++ b/zgrep.in
@@ -28,10 +28,10 @@ case $1 in
 esac
 PATH=$bindir:$PATH
 
-grep='${GREP-grep}'
+grep='${GREP-'\''@GREP@'\''}'
 
 version='zgrep (gzip) @VERSION@
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2010-2013 Free Software Foundation, Inc.
 This is free software.  You may redistribute copies of it under the terms of
 the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
 There is NO WARRANTY, to the extent permitted by law.
@@ -65,7 +65,7 @@ while test $# -ne 0; do
   optarg=
 
   case $option in
-  (-[0123456789EFGHIKLPRTUVZabchilnoqrsuvwxyz]?*)
+  (-[0123456789EFGHIKLPRTUVZabchilnoqrsuvwxyz]*[!0123456789]*)
     arg2=-\'$(expr "X$option" : 'X-.[0-9]*\(.*\)' | sed "$escape")
     eval "set -- $arg2 "'${1+"$@"}'
     option=$(expr "X$option" : 'X\(-.[0-9]*\)');;
@@ -210,14 +210,11 @@ do
         (eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&-
       ) && exit $r
       r=$?
-      test $r -gt 128 && test $r -le 143 && exit $r || exit 2
+      test 1 -lt $r && exit $r || exit 2
     fi >&3 5>&-
   )
   r=$?
-  if test $r -gt 128 && test $r -le 143; then
-    kill -$(($r-128)) $$
-    exit $r
-  fi
+  test 128 -lt $r && exit $r
   test "$gzip_status" -eq 0 || test "$gzip_status" -eq 2 || r=2
   test $res -lt $r && res=$r
 done