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
F102895663: D31108.diff
Mon, Nov 18, 10:51 AM
Unknown Object (File)
Oct 3 2024, 6:53 PM
Unknown Object (File)
Oct 3 2024, 8:51 AM
Unknown Object (File)
Oct 1 2024, 4:04 PM
Unknown Object (File)
Sep 29 2024, 11:02 PM
Unknown Object (File)
Sep 29 2024, 9:55 PM
Unknown Object (File)
Sep 28 2024, 12:37 AM
Unknown Object (File)
Sep 27 2024, 11:20 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