From f7f1a69ff96ecc004c70f556bbd964d9764fc190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Palomas?= Date: Thu, 24 Dec 2020 11:54:24 +0100 Subject: [PATCH 1/2] Removed trailing backslash in Windows Temp path to fix runahead with second instance --- retroarch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/retroarch.c b/retroarch.c index 3574c1a252..b158e69d45 100644 --- a/retroarch.c +++ b/retroarch.c @@ -18460,6 +18460,13 @@ static char *get_temp_directory_alloc(const char *override_dir) path = utf16_to_utf8_string_alloc(wide_str); free(wide_str); #endif + /* + Windows seems to be adding (back)slash at the end of the path... + This can cause issues when concatenating path separators and some I/O apis, so we get rid of it + */ + path_length = strlen(path); + if (path[path_length - 1] == '\\') + path[path_length - 1] = 0; #else #if defined ANDROID src = override_dir; From 8a76fba78b0e5b2a0e3bd71537a779c2e6c8c389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Palomas?= Date: Thu, 24 Dec 2020 11:54:24 +0100 Subject: [PATCH 2/2] Removed trailing backslash in Windows Temp path to fix runahead with second instance --- retroarch.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/retroarch.c b/retroarch.c index 3574c1a252..b158e69d45 100644 --- a/retroarch.c +++ b/retroarch.c @@ -18460,6 +18460,13 @@ static char *get_temp_directory_alloc(const char *override_dir) path = utf16_to_utf8_string_alloc(wide_str); free(wide_str); #endif + /* + Windows seems to be adding (back)slash at the end of the path... + This can cause issues when concatenating path separators and some I/O apis, so we get rid of it + */ + path_length = strlen(path); + if (path[path_length - 1] == '\\') + path[path_length - 1] = 0; #else #if defined ANDROID src = override_dir;