diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-31 21:47:10 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-31 21:47:10 +0000 |
commit | 3936e6df1514a0abddaf56222ac17e78000fd2ac (patch) | |
tree | e105343b12cb2a1133ac34dcd9eafade084d6ce5 /utils/nsurl.c | |
parent | c6f13db85878aeeaa7efd3894db88fe0d8a78168 (diff) | |
download | netsurf-3936e6df1514a0abddaf56222ac17e78000fd2ac.tar.gz netsurf-3936e6df1514a0abddaf56222ac17e78000fd2ac.tar.bz2 |
Remove some code that's not needed. Fix redundant port handling.
svn path=/trunk/netsurf/; revision=13104
Diffstat (limited to 'utils/nsurl.c')
-rw-r--r-- | utils/nsurl.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c index 9978ded15..74d280a4d 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -626,9 +626,7 @@ static nserror nsurl__create_from_section(const char const *url_s, size_t copy_len; size_t length; enum { - NSURL_F_IS_HTTP = (1 << 0), - NSURL_F_IS_HTTPS = (1 << 1), - NSURL_F_NO_PORT = (1 << 2) + NSURL_F_NO_PORT = (1 << 0) } flags = 0; switch (section) { @@ -762,16 +760,6 @@ static nserror nsurl__create_from_section(const char const *url_s, /* Stage 2: Create the URL components for the required section */ switch (section) { case URL_SCHEME: - if (length == 0 || (length == SLEN("http") && - strncmp(norm_start, "http", - SLEN("http")) == 0)) { - flags |= NSURL_F_IS_HTTP; - } else if (length == SLEN("https") && - strncmp(norm_start, "https", - SLEN("https")) == 0) { - flags |= NSURL_F_IS_HTTPS; - } - if (length == 0) { /* No scheme, assuming http, and add to URL */ if (lwc_intern_string("http", SLEN("http"), @@ -865,10 +853,10 @@ static nserror nsurl__create_from_section(const char const *url_s, 1 : 0; sec_start = norm_start + colon - pegs->at + skip; - if (flags & NSURL_F_IS_HTTP && - length - - (colon - pegs->at + skip) == - 2 && + if (url->scheme != NULL && + strncmp(lwc_string_data( + url->scheme), "http", + SLEN("http")) == 0 && *sec_start == '8' && *(sec_start + 1) == '0') { /* Scheme is http, and port is default |