1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-02-01 16:18:25 +00:00

Use ranges::replace

This commit is contained in:
Evil Eye 2025-12-12 23:25:29 +01:00
parent 853a6d1922
commit 9cac246337

View file

@ -39,8 +39,7 @@ namespace Files::Wine
std::string mwpath = line.substr(keyStart.size(), line.rfind('"') - keyStart.size());
if (mwpath.empty())
break;
std::transform(
mwpath.begin(), mwpath.end(), mwpath.begin(), [](char c) { return c == '\\' ? '/' : c; });
std::ranges::replace(mwpath, '\\', '/');
// Change drive letter to lowercase, so we could use ~/.wine/dosdevices symlinks
mwpath[0] = Misc::StringUtils::toLower(mwpath[0]);
std::filesystem::path installPath = homePath / ".wine/dosdevices/" / mwpath;