summaryrefslogtreecommitdiff
path: root/atari/findfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'atari/findfile.c')
-rwxr-xr-xatari/findfile.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/atari/findfile.c b/atari/findfile.c
index da44ab5e4..5001050a6 100755
--- a/atari/findfile.c
+++ b/atari/findfile.c
@@ -55,18 +55,24 @@ char *url_to_path(const char *url)
char *path;
/* return the absolute path including leading / */
- if( atari_sysinfo.gdosversion > TOS4VER ) {
+ if( sys_type() & SYS_MINT ) {
path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN - 1));
} else {
/* do not include / within url_path */
- path = strdup(url_path + (FILE_SCHEME_PREFIX_LEN));
- int l = strlen(path);
- int i;
- for( i = 0; i<l-1; i++){
+ char * drive = url_path + (FILE_SCHEME_PREFIX_LEN);
+ path = malloc( strlen(drive) + 4 );
+ int i=0;
+ path[i++] = drive[0];
+ path[i++] = ':';
+ path[i++] = 0x5C;
+ while( drive[i-1] != 0){
+ path[i] = drive[i-1];
if( path[i] == '/' ){
path[i] = 0x5C;
}
+ i++;
}
+ path[i] = 0;
LOG(("%s", path));
}
curl_free(url_path);