summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2010-02-14 22:38:41 -0500
committerDan Winship <danw@gnome.org>2010-02-14 22:38:41 -0500
commit0375fe59093058d4987af5d74a53a283c3651000 (patch)
treeb32a40c472274d007fd5f7ba2c4cfb374539950e
parenta0694f937b2d30a9c92ddd2c7d6c4d2053b4d385 (diff)
downloadlibsoup-0375fe59093058d4987af5d74a53a283c3651000.tar.gz
[SoupURI] additional fixes to previous commit
-rw-r--r--libsoup/soup-uri.c2
-rw-r--r--tests/uri-parsing.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index b1e5e59b..77a06531 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -198,6 +198,8 @@ soup_uri_new_with_base (SoupURI *base, const char *uri_string)
uri_string += 2;
path = uri_string + strcspn (uri_string, "/?#");
+ if (path > end)
+ path = end;
at = strchr (uri_string, '@');
if (at && at < path) {
colon = strchr (uri_string, ':');
diff --git a/tests/uri-parsing.c b/tests/uri-parsing.c
index 49a92a69..c5aa6b59 100644
--- a/tests/uri-parsing.c
+++ b/tests/uri-parsing.c
@@ -59,6 +59,8 @@ static struct {
"http://host/path%20with%20spaces" },
{ " http://host/path", "http://host/path" },
{ "http://host/path ", "http://host/path" },
+ { "http://host ", "http://host/" },
+ { "http://host:999 ", "http://host:999/" },
{ "http://host/pa\nth", "http://host/path" },
{ "http:\r\n//host/path", "http://host/path" },
{ "http://\thost/path", "http://host/path" },