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) {