netsurf: branch master updated. 70f168b5037a86186af810fbe8d34410ee295456

NetSurf Browser Project (Commit Mailer) no-reply at netsurf-browser.org
Fri Nov 2 10:55:11 GMT 2012


Gitweb links:

...log http://git.netsurf-browser.org/netsurf.git/shortlog/70f168b5037a86186af810fbe8d34410ee295456
...commit http://git.netsurf-browser.org/netsurf.git/commit/70f168b5037a86186af810fbe8d34410ee295456
...tree http://git.netsurf-browser.org/netsurf.git/tree/70f168b5037a86186af810fbe8d34410ee295456

The branch, master has been updated
       via  70f168b5037a86186af810fbe8d34410ee295456 (commit)
       via  9ab851a5a9f951a8d2e7e285489245bee2cd0303 (commit)
      from  efbfbbc96732ba7b0b8f526b07c776908c79533b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/70f168b5037a86186af810fbe8d34410ee295456
commit 70f168b5037a86186af810fbe8d34410ee295456
Merge: 9ab851a efbfbbc
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Merge branch 'master' of git://git.netsurf-browser.org/netsurf



commitdiff http://git.netsurf-browser.org/netsurf.git/commitdiff/9ab851a5a9f951a8d2e7e285489245bee2cd0303
commit 9ab851a5a9f951a8d2e7e285489245bee2cd0303
Author: Michael Drake <tlsa at netsurf-browser.org>
Commit: Michael Drake <tlsa at netsurf-browser.org>

    Fix join with rel part of " ".  Add a few tests.

diff --git a/test/nsurl.c b/test/nsurl.c
index 20109f8..66bc057 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -136,6 +136,12 @@ static const struct test_pairs join_tests[] = {
 	{ "http://",		"http:" },
 	{ "http:/",		"http:" },
 	{ "http:",		"http:" },
+	{ " ",			"http://a/b/c/d;p?q" },
+	{ "  ",			"http://a/b/c/d;p?q" },
+	{ "/",			"http://a/" },
+	{ "  /  ",		"http://a/" },
+	{ "  ?  ",		"http://a/b/c/d;p?" },
+	{ "  h  ",		"http://a/b/c/h" },
 	/* [1] Extra slash beyond rfc3986 5.4.1 example, since we're
 	 *     testing normalisation in addition to joining */
 	/* [2] Using the strict parsers option */
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 8c52545..18577b6 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -264,6 +264,13 @@ static void nsurl__get_string_markers(const char * const url_s,
 	marker.scheme_end = marker.authority = marker.colon_first = marker.at =
 			marker.colon_last = marker.path = marker.start;
 
+	if (*pos == '\0') {
+		/* Nothing but whitespace, early exit */
+		marker.query = marker.fragment = marker.end = marker.path;
+		*markers = marker;
+		return;
+	}
+
 	/* Get scheme */
 	if (isalpha(*pos)) {
 		pos++;


-----------------------------------------------------------------------

Summary of changes:
 test/nsurl.c  |    6 ++++++
 utils/nsurl.c |    7 +++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/test/nsurl.c b/test/nsurl.c
index 20109f8..66bc057 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -136,6 +136,12 @@ static const struct test_pairs join_tests[] = {
 	{ "http://",		"http:" },
 	{ "http:/",		"http:" },
 	{ "http:",		"http:" },
+	{ " ",			"http://a/b/c/d;p?q" },
+	{ "  ",			"http://a/b/c/d;p?q" },
+	{ "/",			"http://a/" },
+	{ "  /  ",		"http://a/" },
+	{ "  ?  ",		"http://a/b/c/d;p?" },
+	{ "  h  ",		"http://a/b/c/h" },
 	/* [1] Extra slash beyond rfc3986 5.4.1 example, since we're
 	 *     testing normalisation in addition to joining */
 	/* [2] Using the strict parsers option */
diff --git a/utils/nsurl.c b/utils/nsurl.c
index 8c52545..18577b6 100644
--- a/utils/nsurl.c
+++ b/utils/nsurl.c
@@ -264,6 +264,13 @@ static void nsurl__get_string_markers(const char * const url_s,
 	marker.scheme_end = marker.authority = marker.colon_first = marker.at =
 			marker.colon_last = marker.path = marker.start;
 
+	if (*pos == '\0') {
+		/* Nothing but whitespace, early exit */
+		marker.query = marker.fragment = marker.end = marker.path;
+		*markers = marker;
+		return;
+	}
+
 	/* Get scheme */
 	if (isalpha(*pos)) {
 		pos++;


-- 
NetSurf Browser



More information about the netsurf-commits mailing list