} else if (!strcasecmp(key, "domain")) {
STR_SET(list->domain, estrndup(value, value_len));
} else if (!strcasecmp(key, "expires")) {
- const char *date = estrndup(value, value_len);
+ char *date = estrndup(value, value_len);
list->expires = http_parse_date(date);
efree(date);
} else if (!strcasecmp(key, "secure")) {
switch (st)
{
case ST_QUOTE:
+ quote:
if (*c == '"') {
- if (*(c-1) != '\\') {
- st = ST_ADD;
- } else {
+ if (*(c-1) == '\\') {
memmove(c-1, c, strlen(c)+1);
+ goto quote;
+ } else {
+ goto add;
}
} else {
if (!val) {
break;
case ';':
- if (!*(c+1)) {
- goto add;
- }
case '\0':
+ goto add;
st = ST_ADD;
break;
add:
if (val) {
vallen = c - val;
- if (*c) --vallen;
- while (val[vallen-1] == ' ') --vallen;
+ if (st != ST_QUOTE) {
+ while (val[vallen-1] == ' ') --vallen;
+ }
} else {
val = "";
vallen = 0;
http_cookie_list_dtor(list);
}
efree(s);
- return FAILURE;
+ return NULL;
}
/* }}} */