Unescape fragment identifiers.

svn path=/trunk/netsurf/; revision=2973
This commit is contained in:
John Mark Bell 2006-10-01 18:10:55 +00:00
parent f4e4ec00b7
commit 118f435133

View File

@ -20,6 +20,7 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "curl/curl.h"
#include "netsurf/utils/config.h"
#include "netsurf/content/fetch.h"
#include "netsurf/content/fetchcache.h"
@ -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.
*/