From a522d9ff14ecf32f3efc694149c44910ea647f29 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 3 Oct 2011 20:54:41 +0000 Subject: Fix host/path with no scheme. svn path=/trunk/netsurf/; revision=12935 --- utils/nsurl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'utils/nsurl.c') diff --git a/utils/nsurl.c b/utils/nsurl.c index 88aef7862..9c0b42ce8 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -196,9 +196,10 @@ static void nsurl__get_string_markers(const char const *url_s, * If this URL is not getting joined, we are less strict in the case of * http(s) and will accept any number of slashes, including 0. */ - if (*pos != '\0' && ((joining == false && is_http == true) || + if (*pos != '\0' && + ((joining == false && is_http == true && *pos != '/') || (*pos == '/' && *(pos + 1) == '/'))) { - /* Skip over leading slashes */ + /* Skip over leading slashes */LOG(("test c: %c", *pos)); if (is_http == false) { if (*pos == '/') pos++; if (*pos == '/') pos++; @@ -236,7 +237,8 @@ static void nsurl__get_string_markers(const char const *url_s, marker.path = pos - url_s; - } else if (*pos == '\0' && joining == false && is_http == true) { + } else if ((*pos == '\0' || *pos == '/') && + joining == false && is_http == true) { marker.path = pos - url_s; } -- cgit v1.2.3