summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-11-20 22:53:55 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2021-11-20 22:55:53 -0800
commitaf79b17356f2edeca2908c14d922a24f659d4a96 (patch)
tree8d443c04de3dd1a609f676f278c8b3c8d5c6d69e /src
parent56762bfda567ac2f96ab2f88e8117b5602bccddb (diff)
downloadgrep-af79b17356f2edeca2908c14d922a24f659d4a96.tar.gz
grep: -s does not suppress “binary file matches”
* src/grep.c (grep): Implement this. * tests/binary-file-matches: Add regression test.
Diffstat (limited to 'src')
-rw-r--r--src/grep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/grep.c b/src/grep.c
index a55194cf..19dff43e 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1646,7 +1646,7 @@ grep (int fd, struct stat const *st, bool *ineof)
finish_grep:
done_on_match = done_on_match_0;
out_quiet = out_quiet_0;
- if (binary_files == BINARY_BINARY_FILES && ! (out_quiet | suppress_errors)
+ if (binary_files == BINARY_BINARY_FILES && !out_quiet
&& (encoding_error_output
|| (0 <= nlines_first_null && nlines_first_null < nlines)))
error (0, 0, _("%s: binary file matches"), input_filename ());