1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Andrs Garca's netscape cookie file parser fix

This commit is contained in:
Daniel Stenberg 2001-05-23 09:26:45 +00:00
parent c77f77a1ce
commit 8dc9f4330c

View File

@ -233,8 +233,18 @@ Curl_cookie_add(struct CookieInfo *c,
/* what _is_ this field for? */ /* what _is_ this field for? */
break; break;
case 2: case 2:
co->path = strdup(ptr); /* It turns out, that sometimes the file format allows the path
break; field to remain not filled in, we try to detect this and work
around it! Andrés García made us aware of this... */
if (strcmp("TRUE", ptr) && strcmp("FALSE", ptr)) {
/* only if the path doesn't look like a boolean option! */
co->path = strdup(ptr);
break;
}
/* this doesn't look like a path, make one up! */
co->path = strdup("/");
fields++; /* add a field and fall down to secure */
/* FALLTHROUGH */
case 3: case 3:
co->secure = strequal(ptr, "TRUE"); co->secure = strequal(ptr, "TRUE");
break; break;