Message ID | 20190523202355.152742-1-emilyshaffer@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v4] grep: fail if call could output and name is null | expand |
Emily Shaffer wrote: > Signed-off-by: Emily Shaffer <emilyshaffer@google.com> > Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> > --- > Since v3, only the commit message has changed. Reworked based on > Jonathan Nieder's suggestions (with some modifications for readability). > > grep.c | 4 ++++ > 1 file changed, 4 insertions(+) This is indeed Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Thanks for your patient work.
Jonathan Nieder <jrnieder@gmail.com> writes: > Emily Shaffer wrote: > >> Signed-off-by: Emily Shaffer <emilyshaffer@google.com> >> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> >> --- >> Since v3, only the commit message has changed. Reworked based on >> Jonathan Nieder's suggestions (with some modifications for readability). >> >> grep.c | 4 ++++ >> 1 file changed, 4 insertions(+) > > This is indeed > Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> > > Thanks for your patient work. Thanks, both. Will queue.
diff --git a/grep.c b/grep.c index 0d50598acd..f7c3a5803e 100644 --- a/grep.c +++ b/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;