summaryrefslogtreecommitdiff
path: root/atari/osspec.c
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-04-10 21:49:27 +0000
committerOle Loots <ole@monochrom.net>2011-04-10 21:49:27 +0000
commit8723876bd53dc4137743e89e2df0ac690e6c1542 (patch)
treec0499e3c18b8510b3dbe95c3745d1bc3e3fb45ab /atari/osspec.c
parent9520ad67fe1435a56078dee76d6f47245b204ad7 (diff)
downloadnetsurf-8723876bd53dc4137743e89e2df0ac690e6c1542.tar.gz
netsurf-8723876bd53dc4137743e89e2df0ac690e6c1542.tar.bz2
cleanup, fixed invalid option name (downloads_path)
svn path=/trunk/netsurf/; revision=12181
Diffstat (limited to 'atari/osspec.c')
-rw-r--r--atari/osspec.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/atari/osspec.c b/atari/osspec.c
index 498b12678..4f412a33f 100644
--- a/atari/osspec.c
+++ b/atari/osspec.c
@@ -9,6 +9,7 @@
#include <mint/cookie.h>
#include <windom.h>
+#include "utils/log.h"
#include "atari/osspec.h"
NS_ATARI_SYSINFO atari_sysinfo;
@@ -16,9 +17,6 @@ NS_ATARI_SYSINFO atari_sysinfo;
unsigned short _systype_v;
unsigned short _systype (void)
{
-_systype_v = (_systype_v & ~0xF) | SYS_MINT | SYS_XAAES;
- return _systype_v;
-
int32_t * cptr = NULL;
_systype_v = SYS_TOS;
@@ -31,9 +29,9 @@ _systype_v = (_systype_v & ~0xF) | SYS_MINT | SYS_XAAES;
_systype_v = (_systype_v & ~0xF) | SYS_MAGIC;
} else if (*cptr == C_MiNT ) {
_systype_v = (_systype_v & ~0xF) | SYS_MINT;
- } else if (*cptr == C_Gnva/*Gnva*/) {
+ } else if (*cptr == C_Gnva /* Gnva */ ) {
_systype_v |= SYS_GENEVA;
- } else if (*cptr == C_nAES/*nAES*/) {
+ } else if (*cptr == C_nAES /* nAES */ ) {
_systype_v |= SYS_NAES;
}
cptr += 2;
@@ -115,6 +113,7 @@ void fix_path(char * path)
return;
}
if( strncmp(path, "/dev/", 5) != 0 ) {
+ /* path is okay, nothing to fix: */
return;
}
strncpy((char*)&npath, path, PATH_MAX);
@@ -123,6 +122,7 @@ void fix_path(char * path)
npath[2] = 0;
strcat((char*)&npath, &path[6]);
strcpy(path, (char*)&npath);
+ LOG(("fixed path: %s\n", path ));
}
/*
@@ -133,7 +133,7 @@ char * gdos_realpath(const char * path, char * rpath)
{
size_t l;
size_t i;
- char old;
+ char old = '/';
char fsep = 0x5C;
if( rpath == NULL ){
return( NULL );
@@ -142,14 +142,6 @@ char * gdos_realpath(const char * path, char * rpath)
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];
@@ -157,13 +149,16 @@ char * gdos_realpath(const char * path, char * rpath)
fix_path((char*)&cwd);
strcpy(rpath, (char*)&cwd);
l = strlen(rpath);
+ /* append path seperator if needed: */
if(rpath[l-1] != 0x5C && rpath[l-1] != '/') {
rpath[l] = fsep;
rpath[l+1] = 0;
}
+ /* check if path is starting with: ./ */
if( (path[1] == '/' || path[1] == 0x5C ) ) {
strcat(rpath, &path[2]);
} else {
+ /* otherwise just append it */
strcat(rpath, path);
}
} else {