From a6fd14c5c821656f92df63bf7906496829cb899b Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Tue, 19 Jul 2005 01:55:16 +0000 Subject: [PATCH] Cd does rember the cd c:\gcc and you can do c: and it jump to c:\gcc not tested in reactos yet. but cd have other bugs that need to be fix. svn path=/trunk/; revision=16639 --- reactos/subsys/system/cmd/internal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/system/cmd/internal.c b/reactos/subsys/system/cmd/internal.c index b3b2fefaf35..7572c3fbfba 100644 --- a/reactos/subsys/system/cmd/internal.c +++ b/reactos/subsys/system/cmd/internal.c @@ -271,7 +271,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) if (!dir || !dir[0]) { TCHAR szPath[MAX_PATH]; - + GetCurrentDirectory (MAX_PATH, szPath); ConOutPuts (szPath); return 0; @@ -290,7 +290,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) TCHAR szPath[MAX_PATH]; szRoot[0] = _totupper (dir[0]); - GetFullPathName (szRoot, MAX_PATH, szPath, NULL); + GetRootPath (szRoot, szPath,MAX_PATH); /* PathRemoveBackslash */ if (_tcslen (szPath) > 3) @@ -314,6 +314,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) lpOldPath = (LPTSTR)malloc (MAX_PATH * sizeof(TCHAR)); GetCurrentDirectory (MAX_PATH, lpOldPath); + chdir(dir); if (!SetCurrentDirectory (dir)) { @@ -338,6 +339,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) { FindClose(hSearch); // change folder + chdir(dir); if (!SetCurrentDirectory (FileData.cFileName)) { ConOutFormatMessage(GetLastError()); @@ -377,6 +379,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param) GetCurrentDirectory(MAX_PATH, dir); if (dir[0]!=lpOldPath[0]) { + chdir(lpOldPath); SetCurrentDirectory(lpOldPath); free(lpOldPath); }