Skip to contentSkip to conversation

attr: explain the lack of attr-name syntax check in parse_attr()

PATCH New Junio C Hamano 1 participant 1 message Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 attr: explain the lack of attr-name syntax check in parse_attr()

---
 attr.c | 6 ++++++
 1 file changed, 6 insertions(+)
attr.c +6 -0
index 94b27f4..aac5c8f 100644
@@ -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++;
Signature · 1 line
2.8.2-748-gfb85f76