diff options
Diffstat (limited to 'grep.c')
-rw-r--r-- | grep.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -873,6 +873,10 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name, count++; if (opt->status_only) return 1; + if (opt->name_only) { + show_name(opt, name); + return 1; + } if (opt->count) goto next_line; if (binary_match_only) { @@ -882,10 +886,6 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name, opt->output(opt, " matches\n", 9); return 1; } - if (opt->name_only) { - show_name(opt, name); - return 1; - } /* Hit at this line. If we haven't shown the * pre-context lines, we would need to show them. */ |