From 68e3f6fc00d68a16e6eb599a08d9302c365351cc Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 17 Oct 2024 13:43:45 -0500 Subject: [PATCH] fix --- support/src/utils/file_directory.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/support/src/utils/file_directory.cpp b/support/src/utils/file_directory.cpp index f633e010..a15c9090 100644 --- a/support/src/utils/file_directory.cpp +++ b/support/src/utils/file_directory.cpp @@ -35,7 +35,7 @@ auto traverse_directory( auto res{true}; const auto is_stop_requested = [&stop_requested]() -> bool { - return (stop_requested != nullptr && !*stop_requested); + return (stop_requested != nullptr && *stop_requested); }; #if defined(_WIN32) @@ -161,7 +161,7 @@ auto directory::create_directory(std::string_view path) const std::string{abs_path} + '|' + std::to_string(res)); } -#else // !defined(_WIN32) +#else // !defined(_WIN32) auto ret{true}; auto paths = utils::string::split(abs_path, utils::path::directory_seperator, false); @@ -169,6 +169,7 @@ auto directory::create_directory(std::string_view path) const std::string current_path; for (std::size_t idx = 0U; !is_stop_requested() && ret && (idx < paths.size()); ++idx) { + if (paths.at(idx).empty()) { current_path = utils::path::directory_seperator; continue; @@ -178,7 +179,7 @@ auto directory::create_directory(std::string_view path) const auto status = mkdir(current_path.c_str(), S_IRWXU); ret = ((status == 0) || (errno == EEXIST)); } -#endif +#endif // defined(_WIN32) return std::make_unique(abs_path); } catch (const std::exception &e) {