Thread (66 messages) flat view 66 messages, 4 authors, 2016-06-15
STALE3727d

[PATCH v1 01/45] setup.c: check that the pathspec magic ends with ")"

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 22:56:24
Subsystem: the rest · Maintainer: Linus Torvalds

From: Andrew Wong <redacted>

The previous code did not diagnose an incorrectly spelled ":(top"
as an error.

Signed-off-by: Andrew Wong <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 setup.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/setup.c b/setup.c
index 1dee47e..d0cd784 100644
--- a/setup.c
+++ b/setup.c
@@ -223,8 +223,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;
-- 
1.8.0.rc0.19.g7bbb31d
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help