Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jun 2018 18:38:48 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334808 - head/usr.bin/grep
Message-ID:  <201806071838.w57IcmsN090163@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Thu Jun  7 18:38:48 2018
New Revision: 334808
URL: https://svnweb.freebsd.org/changeset/base/334808

Log:
  bsdgrep(1): Don't initialize fts_flags twice
  
  Admittedly, this is a clang-scan complaint... but it wasn't wrong. fts_flags
  is initialized by all cases in the switch(), which should be fairly obvious.
  Annotate this anyways.

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

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Thu Jun  7 18:36:12 2018	(r334807)
+++ head/usr.bin/grep/util.c	Thu Jun  7 18:38:48 2018	(r334808)
@@ -148,9 +148,9 @@ grep_tree(char **argv)
 	bool matched, ok;
 	const char *wd[] = { ".", NULL };
 
-	fts_flags = 0;
 	matched = false;
 
+	/* This switch effectively initializes 'fts_flags' */
 	switch(linkbehave) {
 	case LINK_EXPLICIT:
 		fts_flags = FTS_COMFOLLOW;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806071838.w57IcmsN090163>