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, Apr 21, 2:55 AM
Unknown Object (File)
Feb 3 2024, 10:10 PM
Unknown Object (File)
Jan 31 2024, 8:18 AM
Unknown Object (File)
Dec 20 2023, 12:46 AM
Unknown Object (File)
Dec 11 2023, 7:17 AM
Unknown Object (File)
Nov 18 2023, 2:57 AM
Unknown Object (File)
Sep 2 2023, 2:13 AM
Unknown Object (File)
Aug 26 2023, 8:27 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.