From faca1687ceac7c07daf5478071361fe98aa4cafe Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 11 Sep 2010 18:47:36 +0000 Subject: hell with it, heres a version which should result in fewer portability complaints svn path=/trunk/netsurf/; revision=10756 --- framebuffer/findfile.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'framebuffer') diff --git a/framebuffer/findfile.c b/framebuffer/findfile.c index a00f0f835..caa910005 100644 --- a/framebuffer/findfile.c +++ b/framebuffer/findfile.c @@ -47,14 +47,22 @@ char *path_to_url(const char *path) char *url_to_path(const char *url) { - char *url_path = curl_unescape(url, 0); char *path; + char *respath; + url_func_result res; /* result from url routines */ - /* return the absolute path including leading / */ - path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1)); - curl_free(url_path); + res = url_path(url, &path); + if (res != URL_FUNC_OK) { + return NULL; + } + + res = url_unescape(path, &respath); + free(path); + if (res != URL_FUNC_OK) { + return NULL; + } - return path; + return respath; } /** -- cgit v1.2.3