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)
Sat, Dec 27, 11:50 PM
Unknown Object (File)
Nov 13 2025, 12:46 AM
Unknown Object (File)
Nov 12 2025, 9:48 AM
Unknown Object (File)
Nov 11 2025, 8:17 PM
Unknown Object (File)
Nov 11 2025, 7:07 PM
Unknown Object (File)
Nov 11 2025, 6:57 AM
Unknown Object (File)
Nov 10 2025, 3:59 PM
Unknown Object (File)
Nov 3 2025, 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.