fix issues where provided paths could sometimes contain a double slash, this would cause issues as path formatting was disabled (#12999)

Co-authored-by: Tunip3 <tunip3@users.noreply.github.com>
This commit is contained in:
tunip3 2021-09-15 20:44:58 +01:00 committed by GitHub
parent 70376abe1b
commit 249e24fbe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -365,6 +365,13 @@ libretro_vfs_implementation_file *retro_vfs_file_open_impl(
path_wide = utf8_to_utf16_string_alloc(path);
windowsize_path(path_wide);
std::wstring temp_path = path_wide;
while (true) {
size_t p = temp_path.find(L"\\\\");
if (p == std::wstring::npos) break;
temp_path.replace(p, 2, L"\\");
}
path_wide = _wcsdup(temp_path.c_str());
path_str = ref new Platform::String(path_wide);
free(path_wide);