From 8ce0a10670e655d9e3a4f31fedd34baf1a3189b9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 25 Jan 2014 23:00:22 +0000 Subject: move path_to_url and url_to_path to fetch operation table --- monkey/utils.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) (limited to 'monkey/utils.c') diff --git a/monkey/utils.c b/monkey/utils.c index aa7245533..88776a90f 100644 --- a/monkey/utils.c +++ b/monkey/utils.c @@ -25,50 +25,6 @@ #include "utils/url.h" #include "utils/utf8.h" -char *path_to_url(const char *path) -{ - int urllen; - char *url; - - if (path == NULL) { - return NULL; - } - - urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1; - - url = malloc(urllen); - if (url == NULL) { - return NULL; - } - - if (*path == '/') { - path++; /* file: paths are already absolute */ - } - - snprintf(url, urllen, "%s%s", FILE_SCHEME_PREFIX, path); - - return url; -} - -char *url_to_path(const char *url) -{ - char *path; - char *respath; - url_func_result res; /* result from url routines */ - - 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 respath; -} void warn_user(const char *warning, const char *detail) -- cgit v1.2.3