diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-08-09 16:11:58 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-08-09 16:11:58 +0000 |
commit | c9bd6fa9fce386526ea1327adea56128648f3355 (patch) | |
tree | 419a7d4fcfd1a7ae7229763f0b9ed2125be0a02c /desktop/loginlist.c | |
parent | 91e6c7c65bb496f88f6af622f558b35c436f9cd2 (diff) | |
download | netsurf-c9bd6fa9fce386526ea1327adea56128648f3355.tar.gz netsurf-c9bd6fa9fce386526ea1327adea56128648f3355.tar.bz2 |
[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
Diffstat (limited to 'desktop/loginlist.c')
-rw-r--r-- | desktop/loginlist.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/desktop/loginlist.c b/desktop/loginlist.c index 1baab81ac..3161bbd11 100644 --- a/desktop/loginlist.c +++ b/desktop/loginlist.c @@ -31,10 +31,13 @@ static struct login *loginlist = &login; void login_list_add(char *host, char* logindets) { struct login *nli = xcalloc(1, sizeof(*nli)); - char *temp = url_host(host); + char *temp; char *i; + url_func_result res; - assert(temp); + res = url_host(host, &temp); + + assert(res == URL_FUNC_OK); /* Go back to the path base ie strip the document name * eg. http://www.blah.com/blah/test.htm becomes @@ -75,6 +78,7 @@ struct login *login_list_get(char *url) { char *temp, *host; char *i; int reached_scheme = 0; + url_func_result res; if (url == NULL) return NULL; @@ -83,8 +87,8 @@ struct login *login_list_get(char *url) { (strncasecmp(url, "https://", 8) != 0)) return NULL; - host = url_host(url); - if (host == 0 || strlen(host) == 0) return NULL; + res = url_host(url, &host); + if (res != URL_FUNC_OK || strlen(host) == 0) return NULL; temp = xstrdup(url); @@ -93,8 +97,8 @@ struct login *login_list_get(char *url) { */ if (strlen(host) > strlen(temp)) { xfree(temp); - temp = url_host(url); - if (temp == 0 || strlen(temp) == 0) { + res = url_host(url, &temp); + if (res != URL_FUNC_OK || strlen(temp) == 0) { xfree(host); return NULL; } |