[Bug 195763] bsdgrep, empty matches and -o

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat Jan 21 05:32:31 UTC 2017


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

Kyle Evans <bsdports at kyle-evans.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #179171|0                           |1
        is obsolete|                            |

--- Comment #4 from Kyle Evans <bsdports at kyle-evans.net> ---
Created attachment 179173
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=179173&action=edit
Proposed patch to address line matching issues

The failure in bug #181263 case 1 also ended up being fairly straightforward to
address -- pmatch gets clobbered by a non-matching case and ended up with bogus
values, so now we look at the last *actual match* (if st isn't advancing) and
see if that ends up being a zero-length match.

This catches corner cases like the one found where .* can infinitely match but
the 'a' pattern comes second. It shouldn't affect any legitimate cases, since
those will cause an advancement in nst prior to this.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list