mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-25 05:27:00 +03:00
[project @ 2004-04-12 20:43:29 by bursa]
Fix bug in url_join(). svn path=/import/netsurf/; revision=763
This commit is contained in:
parent
7d165500d3
commit
9d4f0a373c
10
utils/url.c
10
utils/url.c
@ -329,7 +329,7 @@ char *url_join(const char *rel, const char *base)
|
||||
path = buf;
|
||||
|
||||
step7: /* 7) */
|
||||
res = malloc(scheme_len + 1 + 2 + authority_len + path_len + 1 +
|
||||
res = malloc(scheme_len + 1 + 2 + authority_len + path_len + 1 + 1 +
|
||||
query_len + 1 + fragment_len + 1);
|
||||
if (!res) {
|
||||
LOG(("malloc failed"));
|
||||
@ -346,8 +346,12 @@ step7: /* 7) */
|
||||
strncpy(res + i, authority, authority_len);
|
||||
i += authority_len;
|
||||
}
|
||||
strncpy(res + i, path, path_len);
|
||||
i += path_len;
|
||||
if (path_len) {
|
||||
strncpy(res + i, path, path_len);
|
||||
i += path_len;
|
||||
} else {
|
||||
res[i++] = '/';
|
||||
}
|
||||
if (query) {
|
||||
res[i++] = '?';
|
||||
strncpy(res + i, query, query_len);
|
||||
|
Loading…
Reference in New Issue
Block a user