mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 02:25:17 +00:00
Use GetShortPathName and GetLongPathName to correct the case of the new path in SetRootPath. GetFullPathName by itself would not work when there was a space in the name.
svn path=/trunk/; revision=17541
This commit is contained in:
parent
9010800221
commit
06c225119d
1 changed files with 11 additions and 6 deletions
|
@ -215,7 +215,8 @@ BOOL SetRootPath(TCHAR *InPath)
|
||||||
{
|
{
|
||||||
TCHAR oldpath[MAX_PATH];
|
TCHAR oldpath[MAX_PATH];
|
||||||
TCHAR OutPath[MAX_PATH];
|
TCHAR OutPath[MAX_PATH];
|
||||||
TCHAR OutPathUpper[MAX_PATH];
|
TCHAR OutPathTemp[MAX_PATH];
|
||||||
|
TCHAR OutPathTemp2[MAX_PATH];
|
||||||
BOOL fail;
|
BOOL fail;
|
||||||
|
|
||||||
|
|
||||||
|
@ -228,16 +229,20 @@ BOOL SetRootPath(TCHAR *InPath)
|
||||||
|
|
||||||
if (_tcsncicmp(&InPath[1],_T(":\\"),2)!=0)
|
if (_tcsncicmp(&InPath[1],_T(":\\"),2)!=0)
|
||||||
{
|
{
|
||||||
if (!GetRootPath(InPath,OutPathUpper,MAX_PATH))
|
if (!GetRootPath(InPath,OutPathTemp,MAX_PATH))
|
||||||
_tcscpy(OutPathUpper,InPath);
|
_tcscpy(OutPathTemp,InPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_tcscpy(OutPathUpper,InPath);
|
_tcscpy(OutPathTemp,InPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
_tcsupr(OutPathUpper);
|
_tcsupr(OutPathTemp);
|
||||||
GetLongPathName(OutPathUpper, OutPath, MAX_PATH);
|
/* The use of both of these together will correct the case of a path
|
||||||
|
where as one alone or GetFullPath will not. Exameple:
|
||||||
|
c:\windows\SYSTEM32 => C:\WINDOWS\system32 */
|
||||||
|
GetShortPathName(OutPathTemp, OutPathTemp2, MAX_PATH);
|
||||||
|
GetLongPathName(OutPathTemp2, OutPath, MAX_PATH);
|
||||||
|
|
||||||
fail = SetCurrentDirectory(OutPath);
|
fail = SetCurrentDirectory(OutPath);
|
||||||
if (!fail)
|
if (!fail)
|
||||||
|
|
Loading…
Reference in a new issue