You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grep - an empty pattern list (-f /dev/null) still opens and reads every file #204
-f FILE with an empty file gives grep no pattern at all, so no line can match. GNU grep
then behaves like -m 0: it exits 1 without opening the files, so a missing file is not
reported and -c prints nothing. uu_grep searches every file anyway: it reports missing
files (exit 2) and prints a 0 count per file. (With -v or -L both tools read the files
and agree.)
Exposed by the GNU test skip-read (grep -f /dev/null no-such-file must exit 1 with no
output, with -G, -E and -F).
Reproduction
$ printf'red\n'> colors
Rust (incorrect)
$ ./target/release/grep -f /dev/null colors absent.txt
grep: absent.txt: No such file or directory
# Exit code: 2
$ ./target/release/grep -c -f /dev/null colors
0
# Exit code: 1
Activity