From a13d1d1ab1d9aa40d16e73c9835dbbbc79993251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Quang=20Ng=C3=B4?= Date: Fri, 18 Oct 2024 22:56:15 +0700 Subject: [PATCH] core/fs: fix file path (again) (#1408) Third time's the charm. --- src/core/file_sys/fs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/file_sys/fs.cpp b/src/core/file_sys/fs.cpp index d86f65a2a..769940cf0 100644 --- a/src/core/file_sys/fs.cpp +++ b/src/core/file_sys/fs.cpp @@ -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); }