Thread (43 messages) flat view 43 messages, 4 authors, 2016-11-09

[PATCHv2 04/36] attr.c: explain the lack of attr-name syntax check in parse_attr()

From: Stefan Beller <hidden>
Date: 2016-10-28 18:55:39
Subsystem: the rest · Maintainer: Linus Torvalds

From: Junio C Hamano <redacted>

Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Stefan Beller <redacted>
---
 attr.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/attr.c b/attr.c
index 007f1a2995..6b55a57ef7 100644
--- a/attr.c
+++ b/attr.c
@@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
 			return NULL;
 		}
 	} else {
+		/*
+		 * As this function is always called twice, once with
+		 * e == NULL in the first pass and then e != NULL in
+		 * the second pass, no need for invalid_attr_name()
+		 * check here.
+		 */
 		if (*cp == '-' || *cp == '!') {
 			e->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET;
 			cp++;
-- 
2.10.1.714.ge3da0db
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help