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 <kevan...@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 */
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to