diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-07 21:16:35 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-10-07 21:16:35 +0000 |
commit | c8bdbdd2e74b96a604a1c20dfb8c517cf7b61064 (patch) | |
tree | c5ab13a2c9f67f933e0cfb2ce06f49d6be11bbbc /utils/nsurl.c | |
parent | 4c829ae481aa155517f114c5cb12e132e7ba3c15 (diff) | |
download | netsurf-c8bdbdd2e74b96a604a1c20dfb8c517cf7b61064.tar.gz netsurf-c8bdbdd2e74b96a604a1c20dfb8c517cf7b61064.tar.bz2 |
Handle joining to a base with no path.
svn path=/trunk/netsurf/; revision=12983
Diffstat (limited to 'utils/nsurl.c')
-rw-r--r-- | utils/nsurl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/nsurl.c b/utils/nsurl.c index 20dc10632..bae757324 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -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); |