[PATCH] Don't push /dev/null as an argument of grep when -c is required.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git@...>
Cc: Pierre Habouzit <madcoder@...>
Date: Tuesday, September 11, 2007 - 6:46 pm

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
 builtin-grep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-grep.c b/builtin-grep.c
index e13cb31..b93fa00 100644
--- a/builtin-grep.c
+++ b/builtin-grep.c
@@ -261,7 +261,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
 	 *
 	 * GNU grep has "-H", but this is portable.
 	 */
-	if (!opt->name_only && !opt->unmatch_name_only)
+	if (!opt->name_only && !opt->unmatch_name_only && !opt->count)
 		push_arg("/dev/null");
 
 	hit = 0;
-- 
1.5.3.1

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[BUG] Funny output from git grep -c, Martin Langhoff, (Tue Sep 11, 6:14 pm)
[PATCH] Don't push /dev/null as an argument of grep when -c ..., Pierre Habouzit, (Tue Sep 11, 6:46 pm)