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
F131670847: D10333.id.diff
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
Unknown Object (File)
Jul 5 2025, 11:20 PM
Unknown Object (File)
Jul 5 2025, 5:27 AM
Unknown Object (File)
Jun 23 2025, 7:44 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.