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