1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-15 15:06:42 +00:00

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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=79423

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 &&