xzgrep.in | xzgrep.in | |||
---|---|---|---|---|
skipping to change at line 109 | skipping to change at line 109 | |||
have_pat=1;; | have_pat=1;; | |||
(--h | --he | --hel | --help) | (--h | --he | --hel | --help) | |||
echo "$usage" || exit 2 | echo "$usage" || exit 2 | |||
exit;; | exit;; | |||
(-H | --wi | --wit | --with | --with- | --with-f | --with-fi \ | (-H | --wi | --wit | --with | --with- | --with-f | --with-fi \ | |||
| --with-fil | --with-file | --with-filen | --with-filena | --with-filena m \ | | --with-fil | --with-file | --with-filen | --with-filena | --with-filena m \ | |||
| --with-filename) | | --with-filename) | |||
with_filename=1 | with_filename=1 | |||
continue;; | continue;; | |||
(-l | --files-with-*) | (-l | --files-with-*) | |||
files_with_matches=1;; | files_with_matches=1 | |||
continue;; | ||||
(-L | --files-witho*) | (-L | --files-witho*) | |||
files_without_matches=1;; | files_without_matches=1 | |||
(--no-f*) | continue;; | |||
(-h | --no-f*) | ||||
no_filename=1;; | no_filename=1;; | |||
(-V | --v | --ve | --ver | --vers | --versi | --versio | --version) | (-V | --v | --ve | --ver | --vers | --versi | --versio | --version) | |||
echo "$version" || exit 2 | echo "$version" || exit 2 | |||
exit;; | exit;; | |||
esac | esac | |||
case $option in | case $option in | |||
(*\'?*) | (*\'?*) | |||
option=\'$(expr "X${option}X" : 'X\(.*\)' | sed "$escape");; | option=\'$(expr "X${option}X" : 'X\(.*\)' | sed "$escape");; | |||
(*) | (*) | |||
skipping to change at line 150 | skipping to change at line 152 | |||
grep="$grep -- '$1'";; | grep="$grep -- '$1'";; | |||
esac | esac | |||
shift | shift | |||
fi | fi | |||
if test $# -eq 0; then | if test $# -eq 0; then | |||
set -- - | set -- - | |||
fi | fi | |||
exec 3>&1 | exec 3>&1 | |||
res=0 | ||||
# res=1 means that no file matched yet | ||||
res=1 | ||||
for i; do | for i; do | |||
case $i in | case $i in | |||
*[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) uncompress="gzip -cdfq";; | *[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) uncompress="gzip -cdfq";; | |||
*[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdfq";; | *[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdfq";; | |||
*[-.]lzo | *[-.]tzo) uncompress="lzop -cdfq";; | *[-.]lzo | *[-.]tzo) uncompress="lzop -cdfq";; | |||
*) uncompress="$xz -cdfq";; | *) uncompress="$xz -cdfq";; | |||
esac | esac | |||
# Fail if xz or grep (or sed) fails. | # Fail if xz or grep (or sed) fails. | |||
xz_status=$( | xz_status=$( | |||
skipping to change at line 198 | skipping to change at line 202 | |||
# Fail if grep or sed fails. | # Fail if grep or sed fails. | |||
r=$( | r=$( | |||
exec 4>&1 | exec 4>&1 | |||
(eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&- | (eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&- | |||
) || r=2 | ) || r=2 | |||
exit $r | exit $r | |||
fi >&3 5>&- | fi >&3 5>&- | |||
) | ) | |||
r=$? | r=$? | |||
# fail occured previously, nothing worse can happen | ||||
test $res -gt 1 && continue | ||||
test "$xz_status" -eq 0 || test "$xz_status" -eq 2 \ | test "$xz_status" -eq 0 || test "$xz_status" -eq 2 \ | |||
|| test "$(kill -l "$xz_status" 2> /dev/null)" = "PIPE" || r=2 | || test "$(kill -l "$xz_status" 2> /dev/null)" = "PIPE" || r=2 | |||
test $res -lt $r && res=$r | ||||
# still no match | ||||
test $r -eq 1 && continue | ||||
# 0 == match, >=2 == fail | ||||
res=$r | ||||
done | done | |||
exit $res | exit $res | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 18 lines changed or added | |||
This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |