Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/1cced51440e550f296553...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/1cced51440e550f2965538b...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/1cced51440e550f2965538b8a...
The branch, master has been updated
via 1cced51440e550f2965538b8a4f72c514eca09b6 (commit)
via 8e96e9bc27f332cf41589d97687f5cafbfda06c5 (commit)
via 13a2ac7c08161868987c929a8b66462fe752f2c7 (commit)
via 0e62d45006195808107295cd9a2d2c83fed504ec (commit)
via 372df59f28c61ff18542693af4a52382f7ba5e7a (commit)
via 465ad9f0ab7a4a7325efce446de1de8d115ef2b7 (commit)
via b605270d4243469bd5fb01dee2fdb6baf95ad678 (commit)
from 0a0e7b5bd74ce5c2aa9700a395fab489d30fc9b9 (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/commit/?id=1cced51440e550f2965...
commit 1cced51440e550f2965538b8a4f72c514eca09b6
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Tests: Add tests for file: URL credentials and host handling.
diff --git a/test/nsurl.c b/test/nsurl.c
index 21b8c01..7e43a6d 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -136,6 +136,12 @@ static const struct test_pairs create_tests[] = {
{ "file:////", "file:////" },
{ "file://///", "file://///" },
+ { "file://localhost/", "file:///" },
+ { "file://foobar/", "file:///" },
+ { "file://foobar", "file:///" },
+ { "file:///foobar", "file:///foobar" },
+ { "file://tlsa@foo/", "file:///" },
+
/* test case insensitivity */
{ "HTTP://a/b", "http://a/b" },
{ "ftp://a/b", "ftp://a/b" },
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=8e96e9bc27f332cf415...
commit 8e96e9bc27f332cf41589d97687f5cafbfda06c5
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
nsurl: Don't allow credentials or host for file: URLs.
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c
index 453c565..a56a78d 100644
--- a/utils/nsurl/parse.c
+++ b/utils/nsurl/parse.c
@@ -818,6 +818,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
url->username = NULL;
url->password = NULL;
+ /* file: URLs don't have credentials */
+ if (url->scheme_type == NSURL_SCHEME_FILE) {
+ break;
+ }
+
if (length != 0 && *norm_start != ':') {
char *sec_start = norm_start;
if (pegs->colon_first != pegs->authority &&
@@ -854,6 +859,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
url->host = NULL;
url->port = NULL;
+ /* file: URLs don't have a host */
+ if (url->scheme_type == NSURL_SCHEME_FILE) {
+ break;
+ }
+
if (length != 0) {
size_t colon = 0;
char *sec_start = norm_start;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=13a2ac7c08161868987...
commit 13a2ac7c08161868987c929a8b66462fe752f2c7
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Tests: Add more file scheme URL parsing tests.
diff --git a/test/nsurl.c b/test/nsurl.c
index 389f2b7..21b8c01 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -129,6 +129,13 @@ static const struct test_pairs create_tests[] = {
{ "mailto:u@a", "mailto:u@a" },
{ "mailto:@a", "mailto:a" },
+ { "file:///", "file:///" },
+ { "file://", "file:///" },
+ { "file:/", "file:///" },
+ { "file:", "file:///" },
+ { "file:////", "file:////" },
+ { "file://///", "file://///" },
+
/* test case insensitivity */
{ "HTTP://a/b", "http://a/b" },
{ "ftp://a/b", "ftp://a/b" },
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=0e62d45006195808107...
commit 0e62d45006195808107295cd9a2d2c83fed504ec
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Tests: Fix file URL component parsing test to match corrected behaviour.
diff --git a/test/nsurl.c b/test/nsurl.c
index a8c4bc0..389f2b7 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -629,7 +629,7 @@ static const struct test_compare component_tests[] = {
{ "file:", NULL, NSURL_PASSWORD, false },
{ "file:", NULL, NSURL_HOST, false },
{ "file:", NULL, NSURL_PORT, false },
- { "file:", NULL, NSURL_PATH, false },
+ { "file:", "/", NSURL_PATH, true },
{ "file:", NULL, NSURL_QUERY, false },
{ "file:", NULL, NSURL_FRAGMENT, false },
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=372df59f28c61ff1854...
commit 372df59f28c61ff18542693af4a52382f7ba5e7a
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
nsurl: Set path of "/" for file: URLs with empty path.
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c
index 293f826..453c565 100644
--- a/utils/nsurl/parse.c
+++ b/utils/nsurl/parse.c
@@ -952,9 +952,13 @@ static nserror nsurl__create_from_section(const char * const url_s,
&url->path) != lwc_error_ok) {
return NSERROR_NOMEM;
}
- } else if (url->host != NULL &&
- url->scheme_type != NSURL_SCHEME_MAILTO) {
- /* Set empty path to "/", if there's a host */
+ } else if ((url->host != NULL &&
+ url->scheme_type != NSURL_SCHEME_MAILTO) ||
+ url->scheme_type == NSURL_SCHEME_FILE) {
+ /* Set empty path to "/" if:
+ * - there's a host and its not a mailto: URL
+ * - its a file: URL
+ */
if (lwc_intern_string("/", SLEN("/"),
&url->path) != lwc_error_ok) {
return NSERROR_NOMEM;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=465ad9f0ab7a4a7325e...
commit 465ad9f0ab7a4a7325efce446de1de8d115ef2b7
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
nsurl: Add detection of "file:" URL schemes.
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c
index 89a10d2..293f826 100644
--- a/utils/nsurl/parse.c
+++ b/utils/nsurl/parse.c
@@ -270,6 +270,16 @@ static void nsurl__get_string_markers(const char * const url_s,
(*(pos - off + 4) == 'S')))) {
marker.scheme_type = NSURL_SCHEME_HTTPS;
is_http = true;
+ } else if (off == SLEN("file") &&
+ (((*(pos - off + 0) == 'f') ||
+ (*(pos - off + 0) == 'F')) &&
+ ((*(pos - off + 1) == 'i') ||
+ (*(pos - off + 1) == 'I')) &&
+ ((*(pos - off + 2) == 'l') ||
+ (*(pos - off + 2) == 'L')) &&
+ ((*(pos - off + 3) == 'e') ||
+ (*(pos - off + 3) == 'E')))) {
+ marker.scheme_type = NSURL_SCHEME_FILE;
} else if (off == SLEN("ftp") &&
(((*(pos - off + 0) == 'f') ||
(*(pos - off + 0) == 'F')) &&
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=b605270d4243469bd5f...
commit b605270d4243469bd5fb01dee2fdb6baf95ad678
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
nsurl: Add "file:" entry to enum of known URL schemes.
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h
index e78f830..89d7ed4 100644
--- a/utils/nsurl/private.h
+++ b/utils/nsurl/private.h
@@ -34,6 +34,7 @@ enum nsurl_scheme_type {
NSURL_SCHEME_OTHER,
NSURL_SCHEME_HTTP,
NSURL_SCHEME_HTTPS,
+ NSURL_SCHEME_FILE,
NSURL_SCHEME_FTP,
NSURL_SCHEME_MAILTO
};
-----------------------------------------------------------------------
Summary of changes:
test/nsurl.c | 15 ++++++++++++++-
utils/nsurl/parse.c | 30 +++++++++++++++++++++++++++---
utils/nsurl/private.h | 1 +
3 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/test/nsurl.c b/test/nsurl.c
index a8c4bc0..7e43a6d 100644
--- a/test/nsurl.c
+++ b/test/nsurl.c
@@ -129,6 +129,19 @@ static const struct test_pairs create_tests[] = {
{ "mailto:u@a", "mailto:u@a" },
{ "mailto:@a", "mailto:a" },
+ { "file:///", "file:///" },
+ { "file://", "file:///" },
+ { "file:/", "file:///" },
+ { "file:", "file:///" },
+ { "file:////", "file:////" },
+ { "file://///", "file://///" },
+
+ { "file://localhost/", "file:///" },
+ { "file://foobar/", "file:///" },
+ { "file://foobar", "file:///" },
+ { "file:///foobar", "file:///foobar" },
+ { "file://tlsa@foo/", "file:///" },
+
/* test case insensitivity */
{ "HTTP://a/b", "http://a/b" },
{ "ftp://a/b", "ftp://a/b" },
@@ -629,7 +642,7 @@ static const struct test_compare component_tests[] = {
{ "file:", NULL, NSURL_PASSWORD, false },
{ "file:", NULL, NSURL_HOST, false },
{ "file:", NULL, NSURL_PORT, false },
- { "file:", NULL, NSURL_PATH, false },
+ { "file:", "/", NSURL_PATH, true },
{ "file:", NULL, NSURL_QUERY, false },
{ "file:", NULL, NSURL_FRAGMENT, false },
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c
index 89a10d2..a56a78d 100644
--- a/utils/nsurl/parse.c
+++ b/utils/nsurl/parse.c
@@ -270,6 +270,16 @@ static void nsurl__get_string_markers(const char * const url_s,
(*(pos - off + 4) == 'S')))) {
marker.scheme_type = NSURL_SCHEME_HTTPS;
is_http = true;
+ } else if (off == SLEN("file") &&
+ (((*(pos - off + 0) == 'f') ||
+ (*(pos - off + 0) == 'F')) &&
+ ((*(pos - off + 1) == 'i') ||
+ (*(pos - off + 1) == 'I')) &&
+ ((*(pos - off + 2) == 'l') ||
+ (*(pos - off + 2) == 'L')) &&
+ ((*(pos - off + 3) == 'e') ||
+ (*(pos - off + 3) == 'E')))) {
+ marker.scheme_type = NSURL_SCHEME_FILE;
} else if (off == SLEN("ftp") &&
(((*(pos - off + 0) == 'f') ||
(*(pos - off + 0) == 'F')) &&
@@ -808,6 +818,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
url->username = NULL;
url->password = NULL;
+ /* file: URLs don't have credentials */
+ if (url->scheme_type == NSURL_SCHEME_FILE) {
+ break;
+ }
+
if (length != 0 && *norm_start != ':') {
char *sec_start = norm_start;
if (pegs->colon_first != pegs->authority &&
@@ -844,6 +859,11 @@ static nserror nsurl__create_from_section(const char * const url_s,
url->host = NULL;
url->port = NULL;
+ /* file: URLs don't have a host */
+ if (url->scheme_type == NSURL_SCHEME_FILE) {
+ break;
+ }
+
if (length != 0) {
size_t colon = 0;
char *sec_start = norm_start;
@@ -942,9 +962,13 @@ static nserror nsurl__create_from_section(const char * const url_s,
&url->path) != lwc_error_ok) {
return NSERROR_NOMEM;
}
- } else if (url->host != NULL &&
- url->scheme_type != NSURL_SCHEME_MAILTO) {
- /* Set empty path to "/", if there's a host */
+ } else if ((url->host != NULL &&
+ url->scheme_type != NSURL_SCHEME_MAILTO) ||
+ url->scheme_type == NSURL_SCHEME_FILE) {
+ /* Set empty path to "/" if:
+ * - there's a host and its not a mailto: URL
+ * - its a file: URL
+ */
if (lwc_intern_string("/", SLEN("/"),
&url->path) != lwc_error_ok) {
return NSERROR_NOMEM;
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h
index e78f830..89d7ed4 100644
--- a/utils/nsurl/private.h
+++ b/utils/nsurl/private.h
@@ -34,6 +34,7 @@ enum nsurl_scheme_type {
NSURL_SCHEME_OTHER,
NSURL_SCHEME_HTTP,
NSURL_SCHEME_HTTPS,
+ NSURL_SCHEME_FILE,
NSURL_SCHEME_FTP,
NSURL_SCHEME_MAILTO
};
--
NetSurf Browser