diff --git a/support/3rd_party/include/utils/path.hpp b/support/3rd_party/include/utils/path.hpp index 8e10e9a8..2dbd2604 100644 --- a/support/3rd_party/include/utils/path.hpp +++ b/support/3rd_party/include/utils/path.hpp @@ -227,11 +227,11 @@ get_parent_api_path(std::wstring_view path) -> std::wstring; [[nodiscard]] auto unmake_file_uri(std::wstring_view uri) -> std::wstring; inline auto absolute(std::string_view path) -> std::string { - return finalize(std::filesystem::absolute(path).lexically_normal().string()); + return std::filesystem::absolute(finalize(path)).lexically_normal().string(); } inline auto absolute(std::wstring_view path) -> std::wstring { - return finalize(std::filesystem::absolute(path).lexically_normal().wstring()); + return std::filesystem::absolute(finalize(path)).lexically_normal().wstring(); } template @@ -239,6 +239,8 @@ template string_t path, const std::vector> &paths) -> string_t { + format_path(path, get_directory_seperator(), + get_not_directory_seperator()); return absolute(std::accumulate( paths.begin(), paths.end(), path, [](auto next_path, auto &&path_part) { if (next_path.empty()) { @@ -341,6 +343,9 @@ template [[nodiscard]] inline auto finalize_t( std::basic_string_view path) -> string_t { string_t fmt_path{path}; + format_path(fmt_path, + get_directory_seperator(), + get_not_directory_seperator()); #if defined(_WIN32) if ((fmt_path.size() >= 2U) && (fmt_path.at(1U) == ':')) { @@ -368,7 +373,7 @@ format_path(string_t &path, -> string_t & { utils::string::replace(path, not_sep, sep); - string_t double_sep{2, sep.at(0U)}; + string_t double_sep{2U, sep.at(0U)}; while (utils::string::contains(path, double_sep)) { utils::string::replace(path, double_sep, sep); }