summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-10-03 20:54:41 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-10-03 20:54:41 +0000
commita522d9ff14ecf32f3efc694149c44910ea647f29 (patch)
tree1d7e727278bf3be789419e63438793b74f4f0ef4
parent3049f37e24a344969177a301a9efb285f487410f (diff)
downloadnetsurf-a522d9ff14ecf32f3efc694149c44910ea647f29.tar.gz
netsurf-a522d9ff14ecf32f3efc694149c44910ea647f29.tar.bz2
Fix host/path with no scheme.
svn path=/trunk/netsurf/; revision=12935
-rw-r--r--utils/nsurl.c8
1 files changed, 5 insertions, 3 deletions
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;
}