Merge branch 'rs/grep-h-c'
"git grep" learns to handle combination of "-h (no header)" and "-c (counts)". * rs/grep-h-c: grep: support -h (no header) with --count t7810: add missing variables to tests in loop
This commit is contained in:
7
grep.c
7
grep.c
@ -1562,8 +1562,11 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
|
||||
*/
|
||||
if (opt->count && count) {
|
||||
char buf[32];
|
||||
output_color(opt, gs->name, strlen(gs->name), opt->color_filename);
|
||||
output_sep(opt, ':');
|
||||
if (opt->pathname) {
|
||||
output_color(opt, gs->name, strlen(gs->name),
|
||||
opt->color_filename);
|
||||
output_sep(opt, ':');
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "%u\n", count);
|
||||
opt->output(opt, buf, strlen(buf));
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user