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, Nov 11, 9:13 AM
Unknown Object (File)
Oct 11 2024, 7:41 AM
Unknown Object (File)
Sep 27 2024, 8:06 PM
Unknown Object (File)
Sep 22 2024, 3:11 PM
Unknown Object (File)
Sep 8 2024, 11:39 PM
Unknown Object (File)
Sep 5 2024, 6:44 PM
Unknown Object (File)
Sep 2 2024, 10:14 PM
Unknown Object (File)
Aug 31 2024, 4:59 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.