summaryrefslogtreecommitdiff
path: root/framebuffer/findfile.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2010-09-11 18:47:36 +0000
committerVincent Sanders <vince@netsurf-browser.org>2010-09-11 18:47:36 +0000
commitfaca1687ceac7c07daf5478071361fe98aa4cafe (patch)
treec576e41756deed0ae9a1d75aa08e9c3fd0ae61c2 /framebuffer/findfile.c
parent4cbb19f2184bc69c408bfffd32b70390f634314c (diff)
downloadnetsurf-faca1687ceac7c07daf5478071361fe98aa4cafe.tar.gz
netsurf-faca1687ceac7c07daf5478071361fe98aa4cafe.tar.bz2
hell with it, heres a version which should result in fewer portability complaints
svn path=/trunk/netsurf/; revision=10756
Diffstat (limited to 'framebuffer/findfile.c')
-rw-r--r--framebuffer/findfile.c18
1 files changed, 13 insertions, 5 deletions
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;
}
/**