From 57dd93f91571a54efc71268dd2e71100b4acb3c3 Mon Sep 17 00:00:00 2001 From: hniksic Date: Fri, 30 Nov 2001 21:22:17 -0800 Subject: [PATCH] [svn] Don't expect HTTP paths to begin with '/'. Published in . --- src/ChangeLog | 5 +++++ src/cookies.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) 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 -- 2.39.2