From 9b6641c95132b2defd38b0dd6ccfba9729c67416 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Mon, 14 Jul 2025 17:37:33 +0200 Subject: [PATCH] (file_path) fill_pathname_join_special - small tweak --- libretro-common/file/file_path.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index a60ce556f3..17486f39d9 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -1005,19 +1005,17 @@ size_t fill_pathname_join_special(char *s, const char *slash = strrchr(s, '/'); const char *backslash = strrchr(s, '\\'); char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash; - if (last_slash) + if (!last_slash) { - /* Try to preserve slash type. */ - if (last_slash != (s + _len - 1)) - { - s[ _len] = last_slash[0]; - s[++_len] = '\0'; - } + s[ _len] = PATH_DEFAULT_SLASH_C(); + s[++_len] = '\0'; + } - else + /* Try to preserve slash type. */ + else if (last_slash != (s + _len - 1)) { - s[ _len] = PATH_DEFAULT_SLASH_C(); - s[++_len] = '\0'; + s[ _len] = last_slash[0]; + s[++_len] = '\0'; } }