summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2003-12-27 23:49:31 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2003-12-27 23:49:31 +0000
commit9ec88eb91f752c2d4487f66e614925ba69d8fe6c (patch)
treef7ff1f82cf22ed4ad11d43a4442a1ed4039fdd12 /utils
parentce0d5294d5898b6100269bd39d38c0884d5fd4b4 (diff)
downloadnetsurf-9ec88eb91f752c2d4487f66e614925ba69d8fe6c.tar.gz
netsurf-9ec88eb91f752c2d4487f66e614925ba69d8fe6c.tar.bz2
[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
Diffstat (limited to 'utils')
-rw-r--r--utils/utils.c29
1 files changed, 28 insertions, 1 deletions
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 <regex.h>
#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)),