summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2012-10-11 17:49:42 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2012-10-11 17:49:42 +0100
commit6b7669dc0914a61d93dbc783783a46064fe61455 (patch)
treebba373ea354344ef047c6933ee01230e2256b841 /render
parent4c4e93ea54bb7146527d4d0a6d313989f7d8d616 (diff)
downloadnetsurf-6b7669dc0914a61d93dbc783783a46064fe61455.tar.gz
netsurf-6b7669dc0914a61d93dbc783783a46064fe61455.tar.bz2
Use nsurl_join instead of url_join. Forms still need to be moved over to nsurl.
Diffstat (limited to 'render')
-rw-r--r--render/html.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/render/html.c b/render/html.c
index 2a15c74d4..a7fbf8a36 100644
--- a/render/html.c
+++ b/render/html.c
@@ -2142,20 +2142,20 @@ html_begin_conversion(html_content *htmlc)
htmlc->forms = html_forms_get_forms(htmlc->encoding,
(dom_html_document *) htmlc->document);
for (f = htmlc->forms; f != NULL; f = f->prev) {
- char *action;
- url_func_result res;
+ nsurl *action;
+ nserror res;
/* Make all actions absolute */
if (f->action == NULL || f->action[0] == '\0') {
- /* HTML5 4.10.22.3 step 11 */
- res = url_join(nsurl_access(content_get_url(&htmlc->base)),
- nsurl_access(htmlc->base_url), &action);
+ /* HTML5 4.10.22.3 step 9 */
+ nsurl *doc_addr = content_get_url(&htmlc->base);
+ res = nsurl_join(htmlc->base_url,
+ nsurl_access(doc_addr), &action);
} else {
- res = url_join(f->action, nsurl_access(htmlc->base_url),
- &action);
+ res = nsurl_join(htmlc->base_url, f->action, &action);
}
- if (res != URL_FUNC_OK) {
+ if (res != NSERROR_OK) {
msg_data.error = messages_get("NoMemory");
content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
dom_node_unref(html);
@@ -2164,7 +2164,15 @@ html_begin_conversion(html_content *htmlc)
}
free(f->action);
- f->action = action;
+ f->action = strdup(nsurl_access(action));
+ nsurl_unref(action);
+ if (f->action == NULL) {
+ msg_data.error = messages_get("NoMemory");
+ content_broadcast(&htmlc->base, CONTENT_MSG_ERROR, msg_data);
+ dom_node_unref(html);
+ dom_node_unref(head);
+ return false;
+ }
/* Ensure each form has a document encoding */
if (f->document_charset == NULL) {