Skip to content

Commit

Permalink
attr.c: explain the lack of attr-name syntax check in parse_attr()
Browse files Browse the repository at this point in the history
Signed-off-by: Junio C Hamano <[email protected]>
Signed-off-by: Stefan Beller <[email protected]>
Signed-off-by: Brandon Williams <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
gitster committed Feb 1, 2017
1 parent 4894f4f commit 5a88401
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 5a88401

Please sign in to comment.