Fix xzgrep to not break if filenames have spaces or quotes.

Thanks to someone who reported the bug on IRC.
This commit is contained in:
Lasse Collin 2010-03-07 19:52:25 +02:00
parent cf38da00a1
commit f4b2b52624
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ for i; do
# Fail if xz or grep (or sed) fails. # Fail if xz or grep (or sed) fails.
xz_status=$( xz_status=$(
exec 5>&1 exec 5>&1
(eval "$uncompress" -- "$i" 5>&-; echo $? >&5) 3>&- | ($uncompress -- "$i" 5>&-; echo $? >&5) 3>&- |
if test $files_with_matches -eq 1; then if test $files_with_matches -eq 1; then
eval "$grep" -q && { printf '%s\n' "$i" || exit 2; } eval "$grep" -q && { printf '%s\n' "$i" || exit 2; }
elif test $files_without_matches -eq 1; then elif test $files_without_matches -eq 1; then