Use UTF-8-safe filesystem paths end-to-end

This commit is contained in:
patchzyy
2026-08-28 19:01:14 +02:00
parent 4897e7e27d
commit b5e5858e1d
26 changed files with 334 additions and 306 deletions
+6 -6
View File
@@ -33,8 +33,8 @@ std::vector<RecompMod::InitializerFn>& PostRelInitializers() {
return initializers;
}
std::vector<std::string>& OverlayRoots() {
static std::vector<std::string> roots;
std::vector<std::filesystem::path>& OverlayRoots() {
static std::vector<std::filesystem::path> roots;
return roots;
}
@@ -279,17 +279,17 @@ void RegisterDvdOverlayRoot(std::string root) {
// against the executable directory instead.
const std::filesystem::path base =
RuntimeConfigFile::ExecutableDirectory().value_or(std::filesystem::current_path());
root = RuntimeConfigFile::ResolveRelativeTo(base, root).string();
std::filesystem::path resolved = RuntimeConfigFile::ResolveRelativeTo(base, root);
std::lock_guard<std::mutex> lock(ModMutex());
auto& roots = OverlayRoots();
const auto it = std::find(roots.begin(), roots.end(), root);
const auto it = std::find(roots.begin(), roots.end(), resolved);
if (it == roots.end()) {
roots.push_back(std::move(root));
roots.push_back(std::move(resolved));
}
}
const std::vector<std::string>& DvdOverlayRoots() {
const std::vector<std::filesystem::path>& DvdOverlayRoots() {
return OverlayRoots();
}