This commit is contained in:
Scott E. Graves 2024-10-17 13:43:45 -05:00
parent a23adf6db6
commit 68e3f6fc00

View File

@ -35,7 +35,7 @@ auto traverse_directory(
auto res{true}; auto res{true};
const auto is_stop_requested = [&stop_requested]() -> bool { const auto is_stop_requested = [&stop_requested]() -> bool {
return (stop_requested != nullptr && !*stop_requested); return (stop_requested != nullptr && *stop_requested);
}; };
#if defined(_WIN32) #if defined(_WIN32)
@ -169,6 +169,7 @@ auto directory::create_directory(std::string_view path) const
std::string current_path; std::string current_path;
for (std::size_t idx = 0U; for (std::size_t idx = 0U;
!is_stop_requested() && ret && (idx < paths.size()); ++idx) { !is_stop_requested() && ret && (idx < paths.size()); ++idx) {
if (paths.at(idx).empty()) { if (paths.at(idx).empty()) {
current_path = utils::path::directory_seperator; current_path = utils::path::directory_seperator;
continue; continue;
@ -178,7 +179,7 @@ auto directory::create_directory(std::string_view path) const
auto status = mkdir(current_path.c_str(), S_IRWXU); auto status = mkdir(current_path.c_str(), S_IRWXU);
ret = ((status == 0) || (errno == EEXIST)); ret = ((status == 0) || (errno == EEXIST));
} }
#endif #endif // defined(_WIN32)
return std::make_unique<directory>(abs_path); return std::make_unique<directory>(abs_path);
} catch (const std::exception &e) { } catch (const std::exception &e) {