From 118f435133cb5aa3a81fa84e29f69e563e2a0e35 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 1 Oct 2006 18:10:55 +0000 Subject: Unescape fragment identifiers. svn path=/trunk/netsurf/; revision=2973 --- desktop/browser.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'desktop/browser.c') diff --git a/desktop/browser.c b/desktop/browser.c index a6caa14d1..c948c2117 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -20,6 +20,7 @@ #include #include #include +#include "curl/curl.h" #include "netsurf/utils/config.h" #include "netsurf/content/fetch.h" #include "netsurf/content/fetchcache.h" @@ -554,18 +555,18 @@ void browser_window_recalculate_frameset(struct browser_window *bw) { */ void browser_window_set_scale(struct browser_window *bw, float scale, bool all) { while (bw->parent && all) - bw = bw->parent; + bw = bw->parent; browser_window_set_scale_internal(bw, scale); if (bw->parent) bw = bw->parent; - browser_window_recalculate_frameset(bw); + browser_window_recalculate_frameset(bw); } void browser_window_set_scale_internal(struct browser_window *bw, float scale) { int i; - + gui_window_set_scale(bw->window, scale); - + for (i = 0; i < (bw->cols * bw->rows); i++) browser_window_set_scale_internal(&bw->children[i], scale); for (i = 0; i < bw->iframe_count; i++) @@ -818,7 +819,22 @@ void browser_window_go_post(struct browser_window *bw, const char *url, bw->frag_id = 0; } if (hash) { - bw->frag_id = strdup(hash+1); + char *frag = curl_unescape(hash+1, strlen(hash + 1)); + if (!frag) { + free(url2); + warn_user("NoMemory", 0); + return; + } + + bw->frag_id = strdup(frag); + curl_free(frag); + + if (!bw->frag_id) { + free(url2); + warn_user("NoMemory", 0); + return; + } + /* if we're simply moving to another ID on the same page, * don't bother to fetch, just update the window. */ -- cgit v1.2.3