gzip/gzip-1.3.12-zgreppipe.patch

21 lines
503 B
Diff
Raw Permalink Normal View History

diff -ru gzip-1.3.12/zgrep.in gzip-1.3.12-fix/zgrep.in
--- gzip-1.3.12/zgrep.in 2007-02-05 21:54:26.000000000 +0100
+++ gzip-1.3.12-fix/zgrep.in 2007-04-18 22:36:42.000000000 +0200
@@ -141,6 +141,7 @@
exec 3>&1
res=0
+trap break SIGPIPE
for i
do
# Fail if gzip or grep (or sed) fails.
@@ -184,5 +185,8 @@
r=$?
test "$gzip_status" -eq 0 || test "$gzip_status" -eq 2 || r=2
test $res -lt $r && res=$r
+ # SIGPIPE + 128
+ test "$r" -eq 141 && exit $res
done
+trap - SIGPIPE
exit $res