On Fri, Mar 18, 2016 at 12:46 AM, Paul Eggert <egg...@cs.ucla.edu> wrote: > Jim Meyering wrote: >> >> Might be tricky to portably transform that NUL byte into something we >> can embed in a command-line-specified search string. Is there even a >> notation for that? I don't think so. >> >> But NUL problems aside, this also should work, requiring alternation >> in the regexp derived from input with two or more lines, but then >> we'll have to escape embedded '|' bytes, too: > > > How about the attached patch instead? It uses a bigger hammer, which should > address both issues.
Very nice. Thank you very much. You are welcome to push that with changes like the following: - retain the 2-empty-line section separator in NEWS (there's a syntax-check hook to test for that in other packages, but not yet here in gzip) - adjust the test to cover the case of more than one line in -f's input:
diff --git a/NEWS b/NEWS index 541ad94..d60d5cc 100644 --- a/NEWS +++ b/NEWS @@ -39,6 +39,7 @@ GNU gzip NEWS -*- outline -*- This better supports invocations like 'zgrep -f <(COMMAND) B C' in Bash. [bug introduced in gzip-1.2] + * Noteworthy changes in release 1.6 (2013-06-09) [stable] ** New features diff --git a/tests/zgrep-f b/tests/zgrep-f index 9a86550..1ce8cc2 100755 --- a/tests/zgrep-f +++ b/tests/zgrep-f @@ -20,8 +20,8 @@ . "${srcdir=.}/init.sh"; path_prepend_ .. -echo needle > n || framework_failure_ -echo needle > haystack || framework_failure_ +printf 'needle\nn2\n' > n || framework_failure_ +cp n haystack || framework_failure_ gzip haystack || framework_failure_ fail=0