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)
Sun, Aug 16, 4:33 AM
Unknown Object (File)
Sat, Aug 15, 5:44 AM
Unknown Object (File)
Jul 16 2026, 5:30 PM
Unknown Object (File)
Jul 12 2026, 2:10 AM
Unknown Object (File)
Jul 4 2026, 3:52 AM
Unknown Object (File)
Jul 3 2026, 1:54 AM
Unknown Object (File)
Jul 3 2026, 12:42 AM
Unknown Object (File)
Jul 2 2026, 9:01 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.