From: Daniel Stenberg Date: Mon, 25 Mar 2002 09:08:33 +0000 (+0000) Subject: Jacky Lam cookie parser fix for domains with preceeding dot X-Git-Tag: upstream/7.37.1~15602 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=541e5a3b827e6bbd236831fec7e7089664ea5b1c;p=platform%2Fupstream%2Fcurl.git Jacky Lam cookie parser fix for domains with preceeding dot --- diff --git a/lib/cookie.c b/lib/cookie.c index 96452ab..fbf2ed0 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -347,7 +347,13 @@ Curl_cookie_add(struct CookieInfo *c, /* the names are identical */ if(clist->domain && co->domain) { - if(strequal(clist->domain, co->domain)) + if(strequal(clist->domain, co->domain) || + (clist->domain[0]=='.' && + strequal(&(clist->domain[1]), co->domain)) || + (co->domain[0]=='.' && + strequal(clist->domain, &(co->domain[1]))) ) + /* The domains are identical, or at least identical if you skip the + preceeding dot */ replace_old=TRUE; } else if(!clist->domain && !co->domain)