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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Pierre Habouzit <madcoder@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux