Page MenuHomeFreeBSD

bsdgrep(1): Fix zero-length matches when not using the -o flag
ClosedPublic

Authored by kevans on Apr 9 2017, 6:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 4:41 PM
Unknown Object (File)
Sat, Oct 11, 9:37 AM
Unknown Object (File)
Sat, Oct 11, 7:46 AM
Unknown Object (File)
Fri, Oct 10, 5:22 AM
Unknown Object (File)
Tue, Sep 16, 10:54 AM
Unknown Object (File)
Sep 4 2025, 11:48 AM
Unknown Object (File)
Aug 19 2025, 10:35 AM
Unknown Object (File)
Jul 10 2025, 10:20 AM
Subscribers
None

Details

Summary

r316477 broke zero-length matches when not using the -o flag, by skipping over them entirely. When trying to match non-empty lines (i.e. grep -v -e "^$" [file]), this causes problems.

This is likely to break many things in itself, add a regression test for it while I'm here so I don't break it in the future.

Test Plan

Run kyua tests to ensure no further regressions, especially with -o flag behavior.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Apr 9 2017, 7:03 PM

FYI if you use the 'rS' prefix on a SVN rev Phabricator will link it, e.g. rS316477

This revision was automatically updated to reflect the committed changes.