2010-01-29 15:00:15 +01:00
|
|
|
Index: zgrep.in
|
|
|
|
===================================================================
|
2012-10-17 11:19:18 +02:00
|
|
|
--- zgrep.in.orig 2012-01-01 09:53:58.000000000 +0100
|
|
|
|
+++ zgrep.in 2012-10-16 13:22:26.304769138 +0200
|
|
|
|
@@ -174,10 +174,18 @@ res=0
|
2006-12-15 18:09:13 +01:00
|
|
|
|
2007-01-08 22:52:58 +01:00
|
|
|
for i
|
|
|
|
do
|
2006-12-15 18:09:13 +01:00
|
|
|
+ case $i in
|
|
|
|
+ *.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
|
|
|
|
- (gzip -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
|
|
|
+ ($uncompress -cdfq -- "$i" 5>&-; echo $? >&5) 3>&- |
|
2006-12-15 18:09:13 +01:00
|
|
|
if test $files_with_matches -eq 1; then
|
2007-01-08 22:52:58 +01:00
|
|
|
eval "$grep" >/dev/null && { printf '%s\n' "$i" || exit 2; }
|
2006-12-15 18:09:13 +01:00
|
|
|
elif test $files_without_matches -eq 1; then
|