bsdgrep: correct uninitialized variable introduced in r317703

CID:		1374747
Submitted by:	Kyle Evans <kevans91@ksu.edu>
This commit is contained in:
Ed Maste 2017-05-03 13:47:02 +00:00
parent 57b6261f94
commit 83fd8885c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317741

View File

@ -203,12 +203,6 @@ procfile(const char *fn)
int c, last_outed, t, tail;
bool doctx, same_file;
doctx = false;
if ((!pc.binary || binbehave != BINFILE_BIN) && !cflag && !qflag &&
!lflag && !Lflag && (Aflag != 0 || Bflag != 0))
doctx = true;
mcount = mlimit;
if (strcmp(fn, "-") == 0) {
fn = label != NULL ? label : getstr(1);
f = grep_open(NULL);
@ -242,6 +236,12 @@ procfile(const char *fn)
tail = 0;
last_outed = 0;
same_file = false;
doctx = false;
if ((!pc.binary || binbehave != BINFILE_BIN) && !cflag && !qflag &&
!lflag && !Lflag && (Aflag != 0 || Bflag != 0))
doctx = true;
mcount = mlimit;
for (c = 0; c == 0 || !(lflag || qflag); ) {
/* Reset match count for every line processed */