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
This commit is contained in:
commit
ac97dc4fa9
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
|
||||
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…
Reference in New Issue
Block a user