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 <andrew.kw.w@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Andrew Wong committed
Mar 9, 2013 at 18:46 UTC
f612a67eac32d73d781503d39077371977d46eae
1 file changed
+3
-2
setup.c
+3
-2
@@ -216,8 +216,9 @@ static const char *prefix_pathspec(const char *prefix, int prefixlen, const char
216
die("Invalid pathspec magic '%.*s' in '%s'",
217
(int) len, copyfrom, elt);
218
}
219
- if (*copyfrom == ')')
220
- copyfrom++;
219
+ if (*copyfrom != ')')
220
+ die("Missing ')' at the end of pathspec magic in '%s'", elt);
221
+ copyfrom++;
222
} else {
223
/* shorthand */
224
for (copyfrom = elt + 1;