From 9ec88eb91f752c2d4487f66e614925ba69d8fe6c Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 27 Dec 2003 23:49:31 +0000 Subject: [project @ 2003-12-27 23:49:31 by jmb] Add about:cookies. Tidy special URL handling code (it's now been moved into url_join in utils.c). svn path=/import/netsurf/; revision=461 --- utils/utils.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'utils/utils.c') diff --git a/utils/utils.c b/utils/utils.c index cb331a55f..260c1f7ea 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -17,6 +17,10 @@ #include #include "libxml/encoding.h" #include "libxml/uri.h" +#ifdef riscos +#include "netsurf/riscos/about.h" +#include "netsurf/riscos/constdata.h" +#endif #include "netsurf/utils/log.h" #include "netsurf/utils/messages.h" #include "netsurf/utils/utils.h" @@ -172,7 +176,7 @@ char *squash_tolat1(xmlChar *s) /** * Calculate a URL from a relative and base URL. * - * base may be 0 for a new URL, in which case the URL is cannonicalized and + * base may be 0 for a new URL, in which case the URL is canonicalized and * returned. Returns 0 in case of error. */ @@ -183,6 +187,29 @@ char *url_join(char *rel_url, char *base_url) LOG(("rel_url = %s, base_url = %s", rel_url, base_url)); +#ifdef riscos + /* hacky, hacky, hacky... + * It is, however, best to do this here as it avoids + * duplicating code for clicking links and url bar handling. + * It simplifies the code it the other places too (they just + * call this as usual, then we handle it here). + */ + if (strcasecmp(rel_url, "about:") == 0) { + about_create(); + return xstrdup(ABOUT_URL); + } + else if (strcasecmp(rel_url, "about:cookies") == 0) { + cookie_create(); + return xstrdup(COOKIE_URL); + } + else if (strcasecmp(rel_url, "help:") == 0) { + return xstrdup(HELP_URL); + } + else if (strcasecmp(rel_url, "home:") == 0) { + return xstrdup(HOME_URL); + } +#endif + if (!base_url) { res = uri_cannonicalize_string(rel_url, (int)(strlen(rel_url)), -- cgit v1.2.3