summaryrefslogtreecommitdiff
path: root/framebuffer/findfile.c
diff options
context:
space:
mode:
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;
}
/**