summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:08 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-25 21:27:08 (GMT)
commit518e8748979dbe485f519d0f63c3642cc1643f79 (patch)
treefaabd0748cbacbfc92946209e5aeceb9a20884d3
parent90891c6a0a7f9fd575f755dcb1b1e5cc067fc4ed (diff)
parentde99eb0c24d96730de187edd37b9ca9d42b0b05d (diff)
downloadgit-518e8748979dbe485f519d0f63c3642cc1643f79.zip
git-518e8748979dbe485f519d0f63c3642cc1643f79.tar.gz
git-518e8748979dbe485f519d0f63c3642cc1643f79.tar.bz2
Merge branch 'es/grep-require-name-when-needed' into maint
More parameter validation. * es/grep-require-name-when-needed: grep: fail if call could output and name is null
-rw-r--r--grep.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/grep.c b/grep.c
index 0d50598..f7c3a58 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;