From 3ff0a9ad007628dcb76d5cc4ffacdb79bd38fe26 Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 1 Dec 2001 07:34:55 -0800 Subject: [PATCH] [svn] Minor tweak in path_matches in cookies.c. --- src/ChangeLog | 5 +++++ src/cookies.c | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5d4b716a..61024813 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2001-12-01 Hrvoje Niksic + + * cookies.c (path_matches): Return 0 if PREFIX doesn't begin with + '/'. + 2001-12-01 Hrvoje Niksic * cookies.c (path_matches): FULL_PATH doesn't begin with '/', but diff --git a/src/cookies.c b/src/cookies.c index 74316791..d4ccb90a 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -871,12 +871,15 @@ path_matches (const char *full_path, const char *prefix) { int len; - if (*prefix == '/') - /* Our HTTP paths don't begin with /; do the same change to - PREFIX. */ - ++prefix; + if (*prefix != '/') + /* Wget's HTTP paths do not begin with '/' (the URL code treats it + as a separator), but the '/' is assumed when matching against + the cookie stuff. */ + return 0; + ++prefix; len = strlen (prefix); + if (0 != strncmp (full_path, prefix, len)) /* FULL_PATH doesn't begin with PREFIX. */ return 0; -- 2.39.2