diff options
-rw-r--r-- | lib/libfetch/fetch.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c index 720c745..303861a 100644 --- a/lib/libfetch/fetch.c +++ b/lib/libfetch/fetch.c @@ -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 && |