[Bug 253350] Grep regression with --after-context (-A) and --max-count (-m) switches

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Mon Feb 8 16:56:43 UTC 2021


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=253350

Kyle Evans <kevans at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|New                         |In Progress

--- Comment #1 from Kyle Evans <kevans at freebsd.org> ---
Thanks for the report!

This diff will fix it: https://people.freebsd.org/~kevans/grep-m.diff

We previously took the mcount hit to bail out immediately, this change ensures
that we continue processing lines as non-matches until the -A tail runs out.
i.e., changing your second line from bar to foo and re-running the same
scenario should output the first foo as a match and the second as a non-match
with appropriate delimiter with -n specified.

I will clean this up and add a test to commit it a little later today.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the freebsd-bugs mailing list