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) {
|
if (recursive) {
|
||||||
auto p = temp_path;
|
auto p = temp_path;
|
||||||
if (isalpha(p[0]) && p[1] == ':') {
|
if (isalpha(p[0]) && p[1] == ':') {
|
||||||
p += 2
|
p += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through path and call CreateDirectory on path elements
|
// Loop through path and call CreateDirectory on path elements
|
||||||
|
|
@ -413,8 +413,8 @@ bool CreateDirectory(FileParms* parms) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Create only the supplied directory.
|
// Create only the supplied directory.
|
||||||
if (::GetFileAttributes(temp) == INVALID_FILE_ATTRIBUTES) {
|
if (::GetFileAttributes(temp_path) == INVALID_FILE_ATTRIBUTES) {
|
||||||
if (!::CreateDirectory(temp, nullptr)) {
|
if (!::CreateDirectory(temp_path, nullptr)) {
|
||||||
if (::GetLastError() != ERROR_ALREADY_EXISTS) {
|
if (::GetLastError() != ERROR_ALREADY_EXISTS) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue