svn commit: r317741 - head/usr.bin/grep

Ed Maste emaste at FreeBSD.org
Wed May 3 13:47:04 UTC 2017


Author: emaste
Date: Wed May  3 13:47:02 2017
New Revision: 317741
URL: https://svnweb.freebsd.org/changeset/base/317741

Log:
  bsdgrep: correct uninitialized variable introduced in r317703
  
  CID:		1374747
  Submitted by:	Kyle Evans <kevans91 at ksu.edu>

Modified:
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Wed May  3 13:17:01 2017	(r317740)
+++ head/usr.bin/grep/util.c	Wed May  3 13:47:02 2017	(r317741)
@@ -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 */


More information about the svn-src-head mailing list