From c9bd6fa9fce386526ea1327adea56128648f3355 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 9 Aug 2004 16:11:58 +0000 Subject: [project @ 2004-08-09 16:11:58 by jmb] Rework the interface of the URL handing module to allow for multiple error types. Modify save_complete URL rewriting appropriately. svn path=/import/netsurf/; revision=1206 --- render/html.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'render/html.c') diff --git a/render/html.c b/render/html.c index 7bda3b02a..b19e99c30 100644 --- a/render/html.c +++ b/render/html.c @@ -304,8 +304,10 @@ void html_head(struct content *c, xmlNode *head) } else if (strcmp(node->name, "base") == 0) { char *href = (char *) xmlGetProp(node, (const xmlChar *) "href"); if (href) { - char *url = url_normalize(href); - if (url) { + char *url; + url_func_result res; + res = url_normalize(href, &url); + if (res == URL_FUNC_OK) { free(c->data.html.base_url); c->data.html.base_url = url; } @@ -330,6 +332,7 @@ void html_find_stylesheets(struct content *c, xmlNode *head) unsigned int i = STYLESHEET_START; unsigned int last_active = 0; union content_msg_data msg_data; + url_func_result res; /* stylesheet 0 is the base style sheet, * stylesheet 1 is the adblocking stylesheet, @@ -414,9 +417,9 @@ void html_find_stylesheets(struct content *c, xmlNode *head) /* TODO: only the first preferred stylesheets (ie. those with a * title attribute) should be loaded (see HTML4 14.3) */ - url = url_join(href, c->data.html.base_url); + res = url_join(href, c->data.html.base_url, &url); xmlFree(href); - if (!url) + if (res != URL_FUNC_OK) continue; LOG(("linked stylesheet %i '%s'", i, url)); -- cgit v1.2.3