core/fs: fix file path (again) (#1408)

Third time's the charm.
This commit is contained in:
Quang Ngô 2024-10-18 22:56:15 +07:00 committed by GitHub
parent 24bce59f70
commit a13d1d1ab1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,7 +31,8 @@ void MntPoints::UnmountAll() {
std::filesystem::path MntPoints::GetHostPath(std::string_view path, bool* is_read_only) {
// Evil games like Turok2 pass double slashes e.g /app0//game.kpf
std::string corrected_path(path);
while (size_t pos = corrected_path.find("//") != std::string::npos) {
size_t pos = corrected_path.find("//");
while (pos != std::string::npos) {
corrected_path.replace(pos, 2, "/");
pos = corrected_path.find("//", pos + 1);
}