Marcus Meissner
3379b020ff
fix bashisms in bzgrep and bznew scripts (2nd attempt) OBS-URL: https://build.opensuse.org/request/show/259536 OBS-URL: https://build.opensuse.org/package/show/Archiving/bzip2?expand=0&rev=44
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=$?
|