mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
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
This commit is contained in:
parent
3925d142b0
commit
a6fd14c5c8
1 changed files with 5 additions and 2 deletions
|
@ -271,7 +271,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||||
if (!dir || !dir[0])
|
if (!dir || !dir[0])
|
||||||
{
|
{
|
||||||
TCHAR szPath[MAX_PATH];
|
TCHAR szPath[MAX_PATH];
|
||||||
|
|
||||||
GetCurrentDirectory (MAX_PATH, szPath);
|
GetCurrentDirectory (MAX_PATH, szPath);
|
||||||
ConOutPuts (szPath);
|
ConOutPuts (szPath);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -290,7 +290,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||||
TCHAR szPath[MAX_PATH];
|
TCHAR szPath[MAX_PATH];
|
||||||
|
|
||||||
szRoot[0] = _totupper (dir[0]);
|
szRoot[0] = _totupper (dir[0]);
|
||||||
GetFullPathName (szRoot, MAX_PATH, szPath, NULL);
|
GetRootPath (szRoot, szPath,MAX_PATH);
|
||||||
|
|
||||||
/* PathRemoveBackslash */
|
/* PathRemoveBackslash */
|
||||||
if (_tcslen (szPath) > 3)
|
if (_tcslen (szPath) > 3)
|
||||||
|
@ -314,6 +314,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||||
lpOldPath = (LPTSTR)malloc (MAX_PATH * sizeof(TCHAR));
|
lpOldPath = (LPTSTR)malloc (MAX_PATH * sizeof(TCHAR));
|
||||||
GetCurrentDirectory (MAX_PATH, lpOldPath);
|
GetCurrentDirectory (MAX_PATH, lpOldPath);
|
||||||
|
|
||||||
|
chdir(dir);
|
||||||
if (!SetCurrentDirectory (dir))
|
if (!SetCurrentDirectory (dir))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -338,6 +339,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||||
{
|
{
|
||||||
FindClose(hSearch);
|
FindClose(hSearch);
|
||||||
// change folder
|
// change folder
|
||||||
|
chdir(dir);
|
||||||
if (!SetCurrentDirectory (FileData.cFileName))
|
if (!SetCurrentDirectory (FileData.cFileName))
|
||||||
{
|
{
|
||||||
ConOutFormatMessage(GetLastError());
|
ConOutFormatMessage(GetLastError());
|
||||||
|
@ -377,6 +379,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
|
||||||
GetCurrentDirectory(MAX_PATH, dir);
|
GetCurrentDirectory(MAX_PATH, dir);
|
||||||
if (dir[0]!=lpOldPath[0])
|
if (dir[0]!=lpOldPath[0])
|
||||||
{
|
{
|
||||||
|
chdir(lpOldPath);
|
||||||
SetCurrentDirectory(lpOldPath);
|
SetCurrentDirectory(lpOldPath);
|
||||||
free(lpOldPath);
|
free(lpOldPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue