From ee930d97e431667cf2d16a9b68f073fafd172f8b Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 15 Oct 2011 11:51:54 +0000 Subject: Fix handling of no scheme svn path=/trunk/netsurf/; revision=13055 --- test/nsurl.c | 2 ++ utils/nsurl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/test/nsurl.c b/test/nsurl.c index d504469a6..df1b98595 100644 --- a/test/nsurl.c +++ b/test/nsurl.c @@ -39,6 +39,8 @@ static const struct test_pairs create_tests[] = { { "http:/a/b", "http://a/b" }, { "http://a", "http://a/" }, { "http://a/b", "http://a/b" }, + { "www.example.org", "http://www.example.org/" }, + { "www.example.org/x", "http://www.example.org/x" }, { "http://www.netsurf-browser.org:8080/", "http://www.netsurf-browser.org:8080/" }, diff --git a/utils/nsurl.c b/utils/nsurl.c index adc1e35e3..6b309f1f5 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -263,6 +263,8 @@ static void nsurl__get_string_markers(const char const *url_s, } else { /* Not found a scheme */ + pos = url_s + marker.start; + if (joining == false) { /* Assuming no scheme == http */ is_http = true; -- cgit v1.2.3