Page MenuHomeFreeBSD

grep: fix combination of quite and count flag
ClosedPublic

Authored by oshogbo on Jul 8 2021, 11:45 AM.
Tags
None
Referenced Files
F87765177: D31108.diff
Sun, Jul 7, 2:11 PM
Unknown Object (File)
Sun, Jun 16, 3:40 PM
Unknown Object (File)
Sat, Jun 15, 3:32 AM
Unknown Object (File)
Sat, Jun 15, 12:41 AM
Unknown Object (File)
Jun 6 2024, 8:04 AM
Unknown Object (File)
Apr 24 2024, 2:26 AM
Unknown Object (File)
Apr 7 2024, 9:43 AM
Unknown Object (File)
Dec 20 2023, 2:30 AM
Subscribers
None

Details

Summary

When the quite (-q) flag is provided, we don't expect any output.
Currently, the behavior is broken:
$ grep -cq flag util.c
1

$ grep -cs flag util.c
55

First of all, we print a number to stdout. Secondly, it just returns 0 or 1
(which is unexpected). GNU grep with c and q flags doesn't print anything.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable