From f612a67eac32d73d781503d39077371977d46eae Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Sat, 9 Mar 2013 18:46:00 -0500 Subject: setup.c: check that the pathspec magic ends with ")" The previous code did not diagnose an incorrectly spelled ":(top" as an error. Signed-off-by: Andrew Wong Signed-off-by: Junio C Hamano --- setup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'setup.c') diff --git a/setup.c b/setup.c index e61458a7d0..da0d8c80ba 100644 --- a/setup.c +++ b/setup.c @@ -216,8 +216,9 @@ static const char *prefix_pathspec(const char *prefix, int prefixlen, const char die("Invalid pathspec magic '%.*s' in '%s'", (int) len, copyfrom, elt); } - if (*copyfrom == ')') - copyfrom++; + if (*copyfrom != ')') + die("Missing ')' at the end of pathspec magic in '%s'", elt); + copyfrom++; } else { /* shorthand */ for (copyfrom = elt + 1; -- cgit v1.2.3