Skip to content

Commit

Permalink
setup.c: check that the pathspec magic ends with ")"
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Wong authored and Junio C Hamano committed Mar 14, 2013
1 parent 772e47c commit f612a67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f612a67

Please sign in to comment.