From: Lasse Collin Date: Thu, 9 Oct 2014 15:42:14 +0000 (+0300) Subject: xzgrep: Avoid passing both -q and -l to grep. X-Git-Tag: v5.0.8~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f229fa32bf70bf9b109864d216719371af108364;p=thirdparty%2Fxz.git xzgrep: Avoid passing both -q and -l to grep. The behavior of grep -ql varies: - GNU grep behaves like grep -q. - OpenBSD grep behaves like grep -l. POSIX doesn't make it 100 % clear what behavior is expected. Anyway, using both -q and -l at the same time makes no sense so both options simply should never be used at the same time. Thanks to Christian Weisgerber. --- diff --git a/src/scripts/xzgrep.in b/src/scripts/xzgrep.in index b927a559..3ecb7cf0 100644 --- a/src/scripts/xzgrep.in +++ b/src/scripts/xzgrep.in @@ -106,9 +106,11 @@ while test $# -ne 0; do with_filename=1 continue;; (-l | --files-with-*) - files_with_matches=1;; + files_with_matches=1 + continue;; (-L | --files-witho*) - files_without_matches=1;; + files_without_matches=1 + continue;; (-h | --no-f*) no_filename=1;; (-V | --v | --ve | --ver | --vers | --versi | --versio | --version)