From 05c63dbea7a7251bec31bbe4dc34b40d01ad4179 Mon Sep 17 00:00:00 2001 From: superp00t Date: Fri, 17 Nov 2023 16:18:19 -0500 Subject: [PATCH] fix(system/file): fix bugged recursion in CreateDirectory implementation --- bc/system/file/win/Stacked.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bc/system/file/win/Stacked.cpp b/bc/system/file/win/Stacked.cpp index f22e8ed..72e838c 100644 --- a/bc/system/file/win/Stacked.cpp +++ b/bc/system/file/win/Stacked.cpp @@ -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; }