From: hniksic Date: Sat, 1 Dec 2001 05:22:17 +0000 (-0800) Subject: [svn] Don't expect HTTP paths to begin with '/'. X-Git-Tag: v1.13~1976 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=57dd93f91571a54efc71268dd2e71100b4acb3c3 [svn] Don't expect HTTP paths to begin with '/'. Published in . --- diff --git a/src/ChangeLog b/src/ChangeLog index 782448dd..5d4b716a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-01 Hrvoje Niksic + + * cookies.c (path_matches): FULL_PATH doesn't begin with '/', but + PREFIX does. + 2001-12-01 Hrvoje Niksic * cookies.c (check_domain_match): Reimplement to match Netscape's diff --git a/src/cookies.c b/src/cookies.c index a0937e34..74316791 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -869,13 +869,20 @@ find_matching_chains (const char *host, int port, static int path_matches (const char *full_path, const char *prefix) { - int len = strlen (prefix); - if (strncmp (full_path, prefix, len)) + int len; + + if (*prefix == '/') + /* Our HTTP paths don't begin with /; do the same change to + PREFIX. */ + ++prefix; + + len = strlen (prefix); + if (0 != strncmp (full_path, prefix, len)) /* FULL_PATH doesn't begin with PREFIX. */ return 0; /* Length of PREFIX determines the quality of the match. */ - return len; + return len + 1; } static int