forked from pool/bzip2
15 lines
509 B
Diff
15 lines
509 B
Diff
|
diff -Ndurp bzip2-1.0.6/bzgrep bzip2-1.0.6-fix-bashisms/bzgrep
|
||
|
--- bzip2-1.0.6/bzgrep 2007-01-03 04:00:55.000000000 +0200
|
||
|
+++ bzip2-1.0.6-fix-bashisms/bzgrep 2014-10-19 02:07:30.036033876 +0300
|
||
|
@@ -63,9 +63,7 @@ for i do
|
||
|
bzip2 -cdfq "$i" | $grep $opt "$pat"
|
||
|
r=$?
|
||
|
else
|
||
|
- j=${i//\\/\\\\}
|
||
|
- j=${j//|/\\|}
|
||
|
- j=${j//&/\\&}
|
||
|
+ j=$(echo "$i" | sed 's/\\/&&/g;s/|/\\&/g;s/&/\\&/g')
|
||
|
j=`printf "%s" "$j" | tr '\n' ' '`
|
||
|
bzip2 -cdfq "$i" | $grep $opt "$pat" | sed "s|^|${j}:|"
|
||
|
r=$?
|