diff options
author | Ole Loots <ole@monochrom.net> | 2011-03-01 19:27:34 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2011-03-01 19:27:34 +0000 |
commit | a80af90142526d5b026a89fdbac205e93e19d25a (patch) | |
tree | c51ed2c58d1c61b79e7e097b5b966d4977243a7c /atari/findfile.c | |
parent | 46915c6b7b6d67675cb365776a972fde32a24596 (diff) | |
download | netsurf-a80af90142526d5b026a89fdbac205e93e19d25a.tar.gz netsurf-a80af90142526d5b026a89fdbac205e93e19d25a.tar.bz2 |
Implemented OS detection routines provided by GS
svn path=/trunk/netsurf/; revision=11873
Diffstat (limited to 'atari/findfile.c')
-rwxr-xr-x | atari/findfile.c | 16 |
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); |