summaryrefslogtreecommitdiffstats
path: root/archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch
diff options
context:
space:
mode:
Diffstat (limited to 'archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch')
-rw-r--r--archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch b/archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch
new file mode 100644
index 0000000000..9681818ac5
--- /dev/null
+++ b/archive/gzip/patches/gzip-1.3.5-zgrep-sed.patch
@@ -0,0 +1,33 @@
+Ripped from Fedora.
+
+http://bugs.gentoo.org/90626
+
+--- zgrep.in
++++ zgrep.in
+@@ -24,7 +24,7 @@
+
+ PATH="BINDIR:$PATH"; export PATH
+
+-prog=`echo $0 | sed 's|.*/||'`
++prog=`echo "$0" | sed 's|.*/||'`
+ case "$prog" in
+ *egrep) grep=${EGREP-egrep -a} ;;
+ *fgrep) grep=${FGREP-fgrep -a} ;;
+@@ -112,12 +112,15 @@
+ fi
+ $uncompress -cdfq "$i" |
+ if test $files_with_matches -eq 1; then
+- $grep $opt "$pat" > /dev/null && echo $i
++ $grep $opt "$pat" > /dev/null && printf "%s\n" "$i"
+ elif test $files_without_matches -eq 1; then
+- $grep $opt "$pat" > /dev/null || echo $i
++ $grep $opt "$pat" > /dev/null || printf "%s\n" "$i"
+ elif test $with_filename -eq 0 && { test $# -eq 1 || test $no_filename -eq 1; }; then
+ $grep $opt "$pat"
+ else
++ i=${i//\\/\\\\}
++ i=${i//|/\\|}
++ i=${i//&/\\&}
+ if test $with_filename -eq 1; then
+ sed_script="s|^[^:]*:|${i}:|"
+ else