Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Aug 2010 22:55:18 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r211519 - head/usr.bin/grep
Message-ID:  <201008192255.o7JMtI23018711@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Aug 19 22:55:17 2010
New Revision: 211519
URL: http://svn.freebsd.org/changeset/base/211519

Log:
  Revert a minor part of revision 211364:
  
   - Imply -h if single file is grepped, this is the GNU behaviour
  
  This is already done by code above the change and have caused a regression
  since this instance of code does not check Hflag.
  
  Reported by:	davidxu
  Pointy hat to:	delphij

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

Modified: head/usr.bin/grep/grep.c
==============================================================================
--- head/usr.bin/grep/grep.c	Thu Aug 19 22:37:43 2010	(r211518)
+++ head/usr.bin/grep/grep.c	Thu Aug 19 22:55:17 2010	(r211519)
@@ -681,15 +681,12 @@ main(int argc, char *argv[])
 
 	if (dirbehave == DIR_RECURSE)
 		c = grep_tree(aargv);
-	else {
-		if (aargc == 1)
-			hflag = true;
+	else
 		for (c = 0; aargc--; ++aargv) {
 			if ((finclude || fexclude) && !file_matching(*aargv))
 				continue;
 			c+= procfile(*aargv);
 		}
-	}
 
 #ifndef WITHOUT_NLS
 	catclose(catalog);



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