From cc1f27ab7f205136ad2f157435f1d9dcd3cc4bb8 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sun, 27 Sep 2009 17:42:47 +0800 Subject: [PATCH] Fixed: Not adding a trailing slash to CWD in VFS_GetAbsPath --- Kernel/vfs/open.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.20.1