diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-05-10 02:27:41 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-05-10 02:27:41 -0400 |
commit | 96a709f0e738e37fc17fbf1ea9367e8b42c31e4e (patch) | |
tree | 76384885f0fbbed65b71b569fb00e9ed22fea14c | |
parent | 66c3fa5e8e3f32f6d04f4a78ed93d251731baa9c (diff) | |
download | noxcuse-96a709f0e738e37fc17fbf1ea9367e8b42c31e4e.tar.gz |
additional error handling in grep
-rw-r--r-- | src/grep.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -185,6 +185,10 @@ process_stdin: } } } + if (ferror(f) && !(flags & FLAG_s)) { + fprintf(stderr, "%s: ", argv[0]); + perror(filename); + } if (flags & FLAG_c) { if (multifile) printf("%s:%lld\n", filename, count); |