{"thread":{"id":"42335","subject":"[PATCH] attr: explain the lack of attr-name syntax check in parse_attr()","startedAt":"2016-05-15T22:58:40Z","lastAt":"2016-05-15T22:58:40Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"286616","messageId":"xmqqa8jr3p3z.fsf@gitster.mtv.corp.google.com","threadId":"42335","inReplyTo":null,"subject":"[PATCH] attr: explain the lack of attr-name syntax check in parse_attr()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-15T22:58:40Z","receivedAt":"2016-05-15T22:58:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n attr.c | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/attr.c b/attr.c\nindex 94b27f4..aac5c8f 100644\n--- a/attr.c\n+++ b/attr.c\n@@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,\n \t\t\treturn NULL;\n \t\t}\n \t} else {\n+\t\t/*\n+\t\t * As this function is always called twice, once with\n+\t\t * e == NULL in the first pass and then e != NULL in\n+\t\t * the second pass, no need for invalid_attr_name()\n+\t\t * check here.\n+\t\t */\n \t\tif (*cp == '-' || *cp == '!') {\n \t\t\te->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET;\n \t\t\tcp++;\n-- \n2.8.2-748-gfb85f76\n"}]}