Fix a CD bug spotted by ravelo_. This is simlair to bug 690. cd foo\"bar", cd "foo"\"bar"" and other of the sorts are all valid.

svn path=/trunk/; revision=17469
This commit is contained in:
Brandon Turner 2005-08-21 20:44:47 +00:00
parent b1db227eed
commit 1fb85e029e

View file

@ -315,17 +315,14 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
/* Get Current Directory */
GetRootPath(_T("."),szCurrent,MAX_PATH);
/* Remove " */
if(szPath[0] == _T('\"'))
/* Remove " */
i = 0;
while(i < _tcslen(szPath))
{
tmpPath = _tcsstr(szPath,_T("\""));
tmpPath++;
_tcscpy(szPath,tmpPath);
}
if(szPath[_tcslen(szPath) - 1] == _T('\"'))
{
szPath[_tcslen(szPath) - 1] = _T('\0');
if(szPath[i] == _T('\"'))
memmove(&szPath[i],&szPath[i + 1], _tcslen(&szPath[i]) * sizeof(TCHAR));
else
i++;
}
tmpPath = szPath;
@ -339,7 +336,7 @@ INT cmd_chdir (LPTSTR cmd, LPTSTR param)
return 0;
}
/* change to full path if relative path was given */
GetFullPathName(szPath,MAX_PATH,szFinalPath,NULL);