summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-11-08 00:08:38 +0000
committerAlain Magloire <alainm@rcsm.ee.mcgill.ca>1999-11-08 00:08:38 +0000
commit27c08475298482671688553117df43b5be262d27 (patch)
tree42038bda4c672806699f3ebe19c24476298b519b /src
parent0e9c7fa4d7d7e0cba0ca29f165e4ee45ad88ec99 (diff)
downloadgrep-27c08475298482671688553117df43b5be262d27.tar.gz
dont show non-binary files for -A/-B/-C
Diffstat (limited to 'src')
-rw-r--r--src/grep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/grep.c b/src/grep.c
index cf59d3b3..39a79706 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -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;