Skip to content

Commit f612a67

Browse files
andrewkwwgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 772e47c commit f612a67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ static const char *prefix_pathspec(const char *prefix, int prefixlen, const char
216216
die("Invalid pathspec magic '%.*s' in '%s'",
217217
(int) len, copyfrom, elt);
218218
}
219-
if (*copyfrom == ')')
220-
copyfrom++;
219+
if (*copyfrom != ')')
220+
die("Missing ')' at the end of pathspec magic in '%s'", elt);
221+
copyfrom++;
221222
} else {
222223
/* shorthand */
223224
for (copyfrom = elt + 1;

0 commit comments

Comments
 (0)