mirror of
https://github.com/git/git.git
synced 2026-01-11 10:38:53 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
772e47cd67
commit
f612a67eac
5
setup.c
5
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;
|
||||
|
||||
Reference in New Issue
Block a user