Handle shemeless, hostless URLs correctly.

This commit is contained in:
Dag-Erling Smørgrav 2001-07-08 15:59:15 +00:00
parent 74bd3d7698
commit ab39353eef

View File

@ -318,7 +318,7 @@ fetchParseURL(const char *URL)
} else {
p = URL;
}
if (!*URL || *URL == '/')
if (!*URL || *URL == '/' || *URL == '.' || strchr(URL, '/') == NULL)
goto nohost;
p = strpbrk(URL, "/@");
@ -335,8 +335,10 @@ fetchParseURL(const char *URL)
u->pwd[i++] = *q;
p++;
} else p = URL;
} else {
p = URL;
}
/* hostname */
#ifdef INET6
if (*p == '[' && (q = strchr(p + 1, ']')) != NULL &&