fix path handling in linux

This commit is contained in:
Ondřej Novák 2025-05-01 20:22:26 +02:00
parent f9e5b3d1e9
commit f383260a98

View file

@ -32,6 +32,8 @@ std::filesystem::path break_and_compose_path(std::string_view pathname, char sep
// Vše ostatní relativně vůči current_path // Vše ostatní relativně vůči current_path
return std::filesystem::current_path() / utf8_to_path(pathname); return std::filesystem::current_path() / utf8_to_path(pathname);
} else if (p == 0) {
return std::filesystem::current_path().root_path() / utf8_to_path(pathname);
} }
return break_and_compose_path(pathname.substr(0, p), sep) / utf8_to_path(pathname.substr(p + 1)); return break_and_compose_path(pathname.substr(0, p), sep) / utf8_to_path(pathname.substr(p + 1));