diff options
author | Ole Loots <ole@monochrom.net> | 2011-04-10 21:49:27 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2011-04-10 21:49:27 +0000 |
commit | 8723876bd53dc4137743e89e2df0ac690e6c1542 (patch) | |
tree | c0499e3c18b8510b3dbe95c3745d1bc3e3fb45ab /atari/findfile.c | |
parent | 9520ad67fe1435a56078dee76d6f47245b204ad7 (diff) | |
download | netsurf-8723876bd53dc4137743e89e2df0ac690e6c1542.tar.gz netsurf-8723876bd53dc4137743e89e2df0ac690e6c1542.tar.bz2 |
cleanup, fixed invalid option name (downloads_path)
svn path=/trunk/netsurf/; revision=12181
Diffstat (limited to 'atari/findfile.c')
-rwxr-xr-x | atari/findfile.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/atari/findfile.c b/atari/findfile.c index 5001050a6..3b842cff4 100755 --- a/atari/findfile.c +++ b/atari/findfile.c @@ -32,10 +32,9 @@ #include "atari/misc.h" #include "atari/osspec.h" - - char *path_to_url(const char *path) { + /* printf("path2url in: %s\n", path); */ int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1; char *url = malloc(urllen); @@ -45,6 +44,15 @@ char *path_to_url(const char *path) snprintf(url, urllen, "%s%s", FILE_SCHEME_PREFIX, path); + int i=0; + while( url[i] != 0 ){ + if( url[i] == 0x5C ){ + url[i] = '/'; + } + i++; + } + + /* printf("path2url out: %s\n", url); */ return url; } @@ -53,8 +61,9 @@ char *url_to_path(const char *url) { char *url_path = curl_unescape(url, 0); char *path; - + /* printf( "url2path in: %s\n", url_path ); */ /* return the absolute path including leading / */ + /* todo: better check for filesystem? */ if( sys_type() & SYS_MINT ) { path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1)); } else { @@ -76,6 +85,7 @@ char *url_to_path(const char *url) LOG(("%s", path)); } curl_free(url_path); + /* printf( "url2path out: %s\n", path ); */ return path; } |