From 5ad525dc7f3ede7ca4fa6883a2b11956351aecb8 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Tue, 1 Feb 2011 21:24:48 +0000 Subject: Moved some functions to osspec.c svn path=/trunk/netsurf/; revision=11588 --- atari/findfile.c | 78 -------------------------------------------------------- 1 file changed, 78 deletions(-) (limited to 'atari/findfile.c') diff --git a/atari/findfile.c b/atari/findfile.c index ee2fc615b..33af88a64 100755 --- a/atari/findfile.c +++ b/atari/findfile.c @@ -34,8 +34,6 @@ -static void fix_path(char * path); - char *path_to_url(const char *path) { int urllen = strlen(path) + FILE_SCHEME_PREFIX_LEN + 1; @@ -76,82 +74,6 @@ char *url_to_path(const char *url) } - - -/* convert nonsense getcwd path (returned by mintlib getcwd on plain TOS) */ -static void fix_path(char * path) -{ - char npath[PATH_MAX]; - /* only apply fix to paths that contain /dev/ */ - if( strlen(path) < 6 ){ - return; - } - if( strncmp(path, "/dev/", 5) != 0 ) { - return; - } - strncpy((char*)&npath, path, PATH_MAX); - npath[0] = path[5]; - npath[1] = ':'; - npath[2] = 0; - strcat((char*)&npath, &path[6]); - strcpy(path, (char*)&npath); -} - -/* - a fixed version of realpath() which returns valid - paths for TOS which have no root fs. (/ , U: ) -*/ -char * gdos_realpath(const char * path, char * rpath) -{ - size_t l; - size_t i; - char old; - char fsep = 0x5C; - if( rpath == NULL ){ - return( NULL ); - } - if( atari_sysinfo.gdosversion > TOS4VER ){ - return( realpath(path, rpath) ); - } - - if( fsep == '/') { - /* replace '\' with / */ - old = 0x5C; /* / */ - } else { - /* replace '/' with \ */ - old = '/'; - } - - if( path[0] != '/' && path[0] != 0x5c && path[1] != ':') { - /* it is not an absolute path */ - char cwd[PATH_MAX]; - getcwd((char*)&cwd, PATH_MAX); - fix_path((char*)&cwd); - strcpy(rpath, (char*)&cwd); - l = strlen(rpath); - if(rpath[l-1] != 0x5C && rpath[l-1] != '/') { - rpath[l] = fsep; - rpath[l+1] = 0; - } - if( (path[1] == '/' || path[1] == 0x5C ) ) { - strcat(rpath, &path[2]); - } else { - strcat(rpath, path); - } - } else { - strcpy(rpath, path); - } - /* convert path seperator to configured value: */ - l = strlen(rpath); - for( i = 0; i