attr.c: explain the lack of attr-name syntax check in parse_attr()
Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
6
attr.c
6
attr.c
@ -183,6 +183,12 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} 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 == '!') {
|
if (*cp == '-' || *cp == '!') {
|
||||||
e->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET;
|
e->setto = (*cp == '-') ? ATTR__FALSE : ATTR__UNSET;
|
||||||
cp++;
|
cp++;
|
||||||
|
Reference in New Issue
Block a user