CPath: If create dir, and testing if can change in it, revert to previous current dir
This commit is contained in:
parent
72471d1eeb
commit
dcf9762fb2
|
@ -65,7 +65,7 @@ static stdstr RandomDigits(int nDigits)
|
||||||
if(last_digit < 0)
|
if(last_digit < 0)
|
||||||
last_digit =(-last_digit);
|
last_digit =(-last_digit);
|
||||||
last_digit %= 10;
|
last_digit %= 10;
|
||||||
Digits[nDigits - 1] ='0' + last_digit;
|
Digits[nDigits - 1] = (char)('0' + last_digit);
|
||||||
|
|
||||||
return Digits;
|
return Digits;
|
||||||
}
|
}
|
||||||
|
@ -2465,7 +2465,11 @@ BOOL CPath::CreateDirectory(BOOL bCreateIntermediates /*= TRUE*/)
|
||||||
StripTrailingBackslash(PathText);
|
StripTrailingBackslash(PathText);
|
||||||
bSuccess =::CreateDirectory(PathText.c_str(),NULL);
|
bSuccess =::CreateDirectory(PathText.c_str(),NULL);
|
||||||
if(!bSuccess)
|
if(!bSuccess)
|
||||||
bSuccess =ChangeDirectory();
|
{
|
||||||
|
CPath CurrentDir(CPath::CURRENT_DIRECTORY);
|
||||||
|
bSuccess = ChangeDirectory();
|
||||||
|
CurrentDir.ChangeDirectory();
|
||||||
|
}
|
||||||
|
|
||||||
if(!bSuccess && bCreateIntermediates)
|
if(!bSuccess && bCreateIntermediates)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue