When an empty pattern is encountered in the pattern list, I had previously broken bsdgrep to count that as a "match all" and ignore any other patterns in the list. This commit rectifies that mistake, among others: - The -v flag semantics were not quite right; lines matched should have been counted differently based on whether the -v flag was set or not. procline now definitively returns whether it's matched or not, and interpreting that result has been kicked up a level. - Empty patterns with the -x flag was broken similarly to empty patterns with the -w flag. The former is a whole-line match and should be more strict, only matching blank lines. No -x and no -w will will match the empty string at the beginning of each line. - The exit code with -L was broken, w.r.t. modern grep. Modern grap will exit(0) if any file that didn't match was output, so our interpretation was simply backwards. The new interpretation makes sense to me. Tests updated and added to try and catch some of this. This misbehavior was found by autoconf while fixing ports found in PR 229925 expecting either a more sane or a more GNU-like sed. MFC after: 1 week |
||
---|---|---|
.. | ||
awk | ||
basename | ||
bzip2 | ||
cc | ||
cmp | ||
config | ||
cut | ||
diff | ||
dirname | ||
find | ||
gdb | ||
grep | ||
gzip | ||
id | ||
infocmp | ||
jot | ||
ld | ||
m4 | ||
make | ||
mixerctl | ||
mkdep | ||
nbperf | ||
netpgpverify | ||
pr | ||
rump_server | ||
sdiff | ||
sed | ||
shmif_dumpbus | ||
sort | ||
tmux | ||
tr | ||
unifdef | ||
uniq | ||
vmstat | ||
xlint/lint1 |