From: John Hodge Date: Sun, 27 Sep 2009 09:42:47 +0000 (+0800) Subject: Fixed: Not adding a trailing slash to CWD in VFS_GetAbsPath X-Git-Tag: rel0.06~433 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=cc1f27ab7f205136ad2f157435f1d9dcd3cc4bb8;p=tpg%2Facess2.git Fixed: Not adding a trailing slash to CWD in VFS_GetAbsPath --- diff --git a/Kernel/vfs/open.c b/Kernel/vfs/open.c index bb644bb2..7cb4750c 100644 --- a/Kernel/vfs/open.c +++ b/Kernel/vfs/open.c @@ -72,9 +72,10 @@ char *VFS_GetAbsPath(char *Path) } else { cwdLen = strlen(cwd); // Prepend the current directory - ret = malloc(cwdLen+pathLen+1); + ret = malloc(cwdLen+pathLen+2); strcpy(ret, cwd); - strcpy(&ret[cwdLen], Path); + ret[cwdLen] = '/'; + strcpy(&ret[cwdLen+1], Path); // Pre-fill the slash positions pos = 0; @@ -127,7 +128,6 @@ char *VFS_GetAbsPath(char *Path) // `ret` should now be the absolute path LEAVE('s', ret); - Log("VFS_GetAbsPath: RETURN '%s'", ret); return ret; }