mirror of
https://github.com/thunderbrewhq/bc.git
synced 2025-12-12 01:52:30 +00:00
fix(system/file): fix bugged recursion in CreateDirectory implementation
This commit is contained in:
parent
0ed54befe3
commit
05c63dbea7
1 changed files with 3 additions and 3 deletions
|
|
@ -387,7 +387,7 @@ bool CreateDirectory(FileParms* parms) {
|
|||
if (recursive) {
|
||||
auto p = temp_path;
|
||||
if (isalpha(p[0]) && p[1] == ':') {
|
||||
p += 2
|
||||
p += 2;
|
||||
}
|
||||
|
||||
// Loop through path and call CreateDirectory on path elements
|
||||
|
|
@ -413,8 +413,8 @@ bool CreateDirectory(FileParms* parms) {
|
|||
}
|
||||
} else {
|
||||
// Create only the supplied directory.
|
||||
if (::GetFileAttributes(temp) == INVALID_FILE_ATTRIBUTES) {
|
||||
if (!::CreateDirectory(temp, nullptr)) {
|
||||
if (::GetFileAttributes(temp_path) == INVALID_FILE_ATTRIBUTES) {
|
||||
if (!::CreateDirectory(temp_path, nullptr)) {
|
||||
if (::GetLastError() != ERROR_ALREADY_EXISTS) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue