Fix empty port separator and redundant port removal when credentials are present.

svn path=/trunk/netsurf/; revision=13108
This commit is contained in:
Michael Drake 2011-10-31 22:23:02 +00:00
parent a4dc04e44a
commit 3ecf3c1eaf

View File

@ -854,7 +854,7 @@ static nserror nsurl__create_from_section(const char const *url_s,
sec_start = norm_start + colon - pegs->at +
skip;
if (url->scheme != NULL && length -
(colon - pegs->at + 1) == 2 &&
(colon - pegs->at + skip) == 2 &&
*sec_start == '8' &&
*(sec_start + 1) == '0' &&
strncmp(lwc_string_data(
@ -865,7 +865,7 @@ static nserror nsurl__create_from_section(const char const *url_s,
flags |= NSURL_F_NO_PORT;
}
if (length - (colon - pegs->at + 1) <= 0) {
if (length - (colon - pegs->at + skip) <= 0) {
/* No space for a port after the colon
*/
flags |= NSURL_F_NO_PORT;