Testing
[tpg/acess2.git] / Kernel / vfs / open.c
index c0bbbed..0013dee 100644 (file)
@@ -32,7 +32,7 @@ char *VFS_GetAbsPath(char *Path)
         int    pathLen = strlen(Path);
         int    read, write;
         int    pos, slashNum=1, baseLen;
-       Uint    slashOffsets[MAX_PATH_SLASHES] = {0};
+       Uint    slashOffsets[MAX_PATH_SLASHES] = {1};
        char    *cwd = CFGPTR(CFG_VFS_CWD);
         int    cwdLen;
        
@@ -102,9 +102,10 @@ char *VFS_GetAbsPath(char *Path)
                        Log("write = %i, read = %i", write, read);
                        memcpy( &ret[write], &ret[read], pos-read+1 );
                }
-               write = pos+1;
+               write += (pos-read)+1;
+               
                if(slashNum < MAX_PATH_SLASHES)
-                       slashOffsets[ slashNum++ ] = pos;
+                       slashOffsets[ slashNum++ ] = write;
                else {
                        LOG("Path '%s' has too many elements", Path);
                        free(ret);

UCC git Repository :: git.ucc.asn.au