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)
Thu, Nov 13, 12:46 AM
Unknown Object (File)
Wed, Nov 12, 9:48 AM
Unknown Object (File)
Tue, Nov 11, 8:17 PM
Unknown Object (File)
Tue, Nov 11, 7:07 PM
Unknown Object (File)
Tue, Nov 11, 6:57 AM
Unknown Object (File)
Mon, Nov 10, 3:59 PM
Unknown Object (File)
Mon, Nov 3, 1:04 PM
Unknown Object (File)
Mon, Nov 3, 1:04 PM
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.