]> sjero.net Git - wget/commitdiff
[svn] Don't expect HTTP paths to begin with '/'.
authorhniksic <devnull@localhost>
Sat, 1 Dec 2001 05:22:17 +0000 (21:22 -0800)
committerhniksic <devnull@localhost>
Sat, 1 Dec 2001 05:22:17 +0000 (21:22 -0800)
Published in <sxsvgfrv7ky.fsf@florida.arsdigita.de>.

src/ChangeLog
src/cookies.c

index 782448dd7b4d2156dbeebc706b40303defbbaf42..5d4b716ac2018b8037a10285d42fc3758325810d 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * cookies.c (path_matches): FULL_PATH doesn't begin with '/', but
+       PREFIX does.
+
 2001-12-01  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * cookies.c (check_domain_match): Reimplement to match Netscape's
index a0937e348cc67e2e3c6aae64df7c0106f7da50c1..74316791da3591d2e3f3a9e11b1cb8ca3d9da114 100644 (file)
@@ -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