]> sjero.net Git - wget/blobdiff - src/cookies.c
[svn] Minor tweak in path_matches in cookies.c.
[wget] / src / cookies.c
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;