diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-19 01:02:08 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-11-19 01:18:31 -0800 |
commit | 5b8900267ff93688fad2a7ab0b25dc57b42ea9e7 (patch) | |
tree | 31821a748d2982893bd79ddc7e4d4d07de7bb287 /src/grep.c | |
parent | e25ea1223d0fb50e759907cdd88e8096b354cbab (diff) | |
download | grep-5b8900267ff93688fad2a7ab0b25dc57b42ea9e7.tar.gz |
grep -f /dev/null -L PAT FILE outputs FILE
* NEWS: Document this.
* src/grep.c (main): Do not exit right away with -L.
* tests/skip-read: Test for the fix.
Diffstat (limited to 'src/grep.c')
-rw-r--r-- | src/grep.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -2818,8 +2818,9 @@ main (int argc, char **argv) /* If it is easy to see that matching cannot succeed (e.g., 'grep -f /dev/null'), fail without reading the input. */ - if (max_count == 0 - || (keycc == 0 && out_invert && !match_lines && !match_words)) + if ((max_count == 0 + || (keycc == 0 && out_invert && !match_lines && !match_words)) + && list_files != LISTFILES_NONMATCHING) return EXIT_FAILURE; if (color_option == 2) |