mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
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:
parent
b1db227eed
commit
1fb85e029e
1 changed files with 8 additions and 11 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue