summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2017-03-27 12:09:45 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2017-03-27 12:09:45 +0100
commit465ad9f0ab7a4a7325efce446de1de8d115ef2b7 (patch)
tree433bd300d23b7908ff37d9f6bf0cc5343875b7e4 /utils
parentb605270d4243469bd5fb01dee2fdb6baf95ad678 (diff)
downloadnetsurf-465ad9f0ab7a4a7325efce446de1de8d115ef2b7.tar.gz
netsurf-465ad9f0ab7a4a7325efce446de1de8d115ef2b7.tar.bz2
nsurl: Add detection of "file:" URL schemes.
Diffstat (limited to 'utils')
-rw-r--r--utils/nsurl/parse.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c
index 89a10d244..293f8268d 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')) &&