]> sjero.net Git - wget/commitdiff
[svn] Minor tweak in path_matches in cookies.c.
authorhniksic <devnull@localhost>
Sat, 1 Dec 2001 15:34:55 +0000 (07:34 -0800)
committerhniksic <devnull@localhost>
Sat, 1 Dec 2001 15:34:55 +0000 (07:34 -0800)
src/ChangeLog
src/cookies.c

index 5d4b716ac2018b8037a10285d42fc3758325810d..6102481351ad25f6af039f7df47e745f507077a3 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * cookies.c (path_matches): Return 0 if PREFIX doesn't begin with
+       '/'.
+
 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * cookies.c (path_matches): FULL_PATH doesn't begin with '/', but
index 74316791da3591d2e3f3a9e11b1cb8ca3d9da114..d4ccb90ac8221a0409efdd3e356a438c3661570c 100644 (file)
@@ -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;