diff options
author | Andrew Wong <andrew.kw.w@gmail.com> | 2013-03-10 00:46:00 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-03-14 17:39:36 +0100 |
commit | f612a67eac32d73d781503d39077371977d46eae (patch) | |
tree | 60641e0f30550d598940fecb348990782a318ffe /setup.c | |
parent | setup.c: stop prefix_pathspec() from looping past the end of string (diff) | |
download | git-f612a67eac32d73d781503d39077371977d46eae.tar.xz git-f612a67eac32d73d781503d39077371977d46eae.zip |
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>
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |