* zgrep.in: Don't assume the exit status is the signal number plus
128, as POSIX doesn't require this.  No need to kill self; exiting
with large status is enough.  Propagate all exit statuses greater
than 1, not merely those in the range 129..143, as there's no need
to treat that range specially (and it's not portable anyway).
---
 zgrep.in |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/zgrep.in b/zgrep.in
index 68396db..d0dea15 100644
--- a/zgrep.in
+++ b/zgrep.in
@@ -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
-- 
1.7.2


Reply via email to