From: John Hodge Date: Sun, 27 Sep 2009 10:25:30 +0000 (+0800) Subject: Made it _look_ like the leading / is included X-Git-Tag: rel0.06~421 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=0e47c27c2e1ef15f2f8d03194f0ab7c900c65b13;p=tpg%2Facess2.git Made it _look_ like the leading / is included --- diff --git a/Kernel/vfs/open.c b/Kernel/vfs/open.c index 1d869103..c0bbbed8 100644 --- a/Kernel/vfs/open.c +++ b/Kernel/vfs/open.c @@ -31,8 +31,8 @@ char *VFS_GetAbsPath(char *Path) char *ret; int pathLen = strlen(Path); int read, write; - int pos, slashNum=0, baseLen; - Uint slashOffsets[MAX_PATH_SLASHES]; + int pos, slashNum=1, baseLen; + Uint slashOffsets[MAX_PATH_SLASHES] = {0}; char *cwd = CFGPTR(CFG_VFS_CWD); int cwdLen; @@ -69,7 +69,7 @@ char *VFS_GetAbsPath(char *Path) } // Remove . and .. - read = write = 0; // Cwd has already been parsed + read = write = 1; // Cwd has already been parsed for(; read < baseLen+pathLen; read = pos+1) { pos = strpos( &ret[read], '/' );