diff options
author | Alain Magloire <alainm@rcsm.ee.mcgill.ca> | 1999-11-08 00:08:38 +0000 |
---|---|---|
committer | Alain Magloire <alainm@rcsm.ee.mcgill.ca> | 1999-11-08 00:08:38 +0000 |
commit | 27c08475298482671688553117df43b5be262d27 (patch) | |
tree | 42038bda4c672806699f3ebe19c24476298b519b /src | |
parent | 0e9c7fa4d7d7e0cba0ca29f165e4ee45ad88ec99 (diff) | |
download | grep-27c08475298482671688553117df43b5be262d27.tar.gz |
dont show non-binary files for -A/-B/-C
Diffstat (limited to 'src')
-rw-r--r-- | src/grep.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -489,6 +489,7 @@ static int count_matches; /* Count matching lines. */ static int list_files; /* List matching files. */ static int no_filenames; /* Suppress file names. */ static int suppress_errors; /* Suppress diagnostics. */ +static int not_text; /* Whether or not the file is "text" */ /* Internal variables to keep track of byte count, context, etc. */ static off_t totalcc; /* Total character count before bufbeg. */ @@ -642,7 +643,7 @@ prtext (beg, lim, nlinesp) if (!out_quiet) prline (beg, lim, ':'); - pending = out_after; + pending = (not_text) ? 0 : out_after; used = 1; } @@ -698,7 +699,6 @@ grep (fd, file, stats) struct stats *stats; { int nlines, i; - int not_text; size_t residue, save; char *beg, *lim; char eol = eolbyte; |