case ST_KEY:
switch (*c)
{
- default:
- if (!isalnum(*c)) {
- goto failure;
- }
- case '.':
- case '_':
- case '$':
- case '@':
- if (!key) {
- key = c;
- }
+ case ',':
+ case '\r':
+ case '\n':
+ case '\t':
+ case '\013':
+ case '\014':
+ goto failure;
break;
- case ' ':
+ case '=':
if (key) {
keylen = c - key;
- st = ST_ASSIGN;
+ st = ST_VALUE;
+ } else {
+ goto failure;
}
break;
- case '=':
+ case ' ':
if (key) {
keylen = c - key;
- st = ST_VALUE;
- } else {
- goto failure;
+ st = ST_ASSIGN;
}
break;
st = ST_ADD;
}
break;
+
+ default:
+ if (!key) {
+ key = c;
+ }
+ break;
}
break;
case ST_ASSIGN:
if (*c == '=') {
st = ST_VALUE;
- } else if (*c == ';') {
+ } else if (!*c || *c == ';') {
st = ST_ADD;
} else if (*c != ' ') {
goto failure;