Handle joining to a base with no path.

svn path=/trunk/netsurf/; revision=12983
This commit is contained in:
Michael Drake 2011-10-07 21:16:35 +00:00
parent 4c829ae481
commit c8bdbdd2e7

View File

@ -1506,11 +1506,13 @@ nserror nsurl_join(const nsurl *base, const char *rel, nsurl **joined)
* space for path merging (if required). */
if (joined_parts & NSURL_F_MERGED_PATH) {
/* Need to merge paths */
length += lwc_string_length(base->path);
length += (base->path != NULL) ?
lwc_string_length(base->path) : 0;
}
length *= 4;
/* Plus space for removing dots from path */
length += (m.query - m.path) + lwc_string_length(base->path);
length += (m.query - m.path) + ((base->path != NULL) ?
lwc_string_length(base->path) : 0);
buff = malloc(length + 5);
if (buff == NULL) {
free(*joined);