Browse Source

Merge branch 'es/grep-require-name-when-needed'

More parameter validation.

* es/grep-require-name-when-needed:
  grep: fail if call could output and name is null
maint
Junio C Hamano 6 years ago
parent
commit
ac97dc4fa9
  1. 4
      grep.c

4
grep.c

@ -1780,6 +1780,10 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle @@ -1780,6 +1780,10 @@ static int grep_source_1(struct grep_opt *opt, struct grep_source *gs, int colle
enum grep_context ctx = GREP_CONTEXT_HEAD;
xdemitconf_t xecfg;

if (!opt->status_only && gs->name == NULL)
BUG("grep call which could print a name requires "
"grep_source.name be non-NULL");

if (!opt->output)
opt->output = std_output;


Loading…
Cancel
Save