From 27c08475298482671688553117df43b5be262d27 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 8 Nov 1999 00:08:38 +0000 Subject: dont show non-binary files for -A/-B/-C --- src/grep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.1