2010-01-29 15:00:15 +01:00
|
|
|
Index: zgrep.in
|
|
|
|
===================================================================
|
2022-04-09 14:42:32 +02:00
|
|
|
--- zgrep.in.orig
|
|
|
|
+++ zgrep.in
|
|
|
|
@@ -211,10 +211,18 @@ res=1
|
2006-12-15 18:09:13 +01:00
|
|
|
|
2007-01-08 22:52:58 +01:00
|
|
|
for i
|
|
|
|
do
|
2022-04-09 14:42:32 +02:00
|
|
|
+ case "$i" in
|
2006-12-15 18:09:13 +01:00
|
|
|
+ *.bz2)
|
|
|
|
+ uncompress=bzip2
|
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ uncompress=gzip
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
2007-01-08 22:52:58 +01:00
|
|
|
# Fail if gzip or grep (or sed) fails.
|
|
|
|
gzip_status=$(
|
|
|
|
exec 5>&1
|
2022-04-09 14:42:32 +02:00
|
|
|
- ('gzip' -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
2007-01-08 22:52:58 +01:00
|
|
|
+ ($uncompress -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
2006-12-15 18:09:13 +01:00
|
|
|
if test $files_with_matches -eq 1; then
|
2022-04-09 14:42:32 +02:00
|
|
|
eval "$grep$args" >/dev/null && { printf '%s\n' "$i" || exit 2; }
|
2006-12-15 18:09:13 +01:00
|
|
|
elif test $files_without_matches -eq 1; then
|