From: Daniel Stenberg Date: Wed, 23 May 2001 09:26:45 +0000 (+0000) Subject: Andrés García's netscape cookie file parser fix X-Git-Tag: curl-7_8-pre2~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8dc9f4330c4d9c16c21d6e7c1e94608b6c8f4959;p=thirdparty%2Fcurl.git Andrés García's netscape cookie file parser fix --- diff --git a/lib/cookie.c b/lib/cookie.c index d1c308304e..3c4034c423 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -233,8 +233,18 @@ Curl_cookie_add(struct CookieInfo *c, /* what _is_ this field for? */ break; case 2: - co->path = strdup(ptr); - break; + /* It turns out, that sometimes the file format allows the path + 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: co->secure = strequal(ptr, "TRUE"); break;