From c38208ad5ecf7d8d7b6592e3c6aa86cf55220c34 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 19 Aug 2010 22:55:17 +0000 Subject: [PATCH] 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 --- usr.bin/grep/grep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/usr.bin/grep/grep.c b/usr.bin/grep/grep.c index 3cb277cb97a2..f531c5665724 100644 --- a/usr.bin/grep/grep.c +++ b/usr.bin/grep/grep.c @@ -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);