diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2017-03-27 18:09:29 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2017-03-27 18:09:29 +0100 |
commit | 7338f3ce8846fb6a78e8691e79a8c83474a6ac9a (patch) | |
tree | a3272381aac408aa7e94ca9705138b6107c532b8 | |
parent | f90559d2db0132e877adff474895600d9c8fe65f (diff) | |
download | netsurf-7338f3ce8846fb6a78e8691e79a8c83474a6ac9a.tar.gz netsurf-7338f3ce8846fb6a78e8691e79a8c83474a6ac9a.tar.bz2 |
nsurl: Remove redundant code path.
-rw-r--r-- | utils/nsurl/parse.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/utils/nsurl/parse.c b/utils/nsurl/parse.c index 7e7873200..7474a612d 100644 --- a/utils/nsurl/parse.c +++ b/utils/nsurl/parse.c @@ -1430,14 +1430,15 @@ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined) struct url_markers m_path; size_t new_length; - if (base->components.host != NULL && - base->components.path == NULL) { - /* Append relative path to "/". */ - *(buff_pos++) = '/'; - memcpy(buff_pos, rel + m.path, m.query - m.path); - buff_pos += m.query - m.path; - - } else { + /* RFC3986 said to append relative path to "/" if the + * base path had no path and an authority. + * + * However, that specification is redundant, and base paths + * are normalised, so file, http, and https URLs will always + * have a non-empty path. (Empty paths become "/".) + */ + + { /* Append relative path to all but last segment of * base path. */ size_t path_end = lwc_string_length( |