From 8928052863a28b0d3fb90c78b7b906ee30a9b50b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 18 Sep 2019 02:23:25 +0200 Subject: [PATCH] (libretro-common) (VFS implementation) Cleanup --- libretro-common/vfs/vfs_implementation.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index faa4c33abd..e7cfaa7b31 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -1152,15 +1152,10 @@ libretro_vfs_implementation_dir *retro_vfs_opendir_impl( copied = strlcpy(path_buf, name, sizeof(path_buf)); /* Non-NT platforms don't like extra slashes in the path */ - if (name[path_len - 1] == '\\') - { - string_add_star_fast(path_buf, copied); - } - else - { - path_buf[copied] = '\\'; - string_add_star_fast(path_buf, copied+1); - } + if (name[path_len - 1] != '\\') + path_buf[copied++] = '\\'; + + string_add_star_fast(path_buf, copied); #if defined(LEGACY_WIN32) path_local = utf8_to_local_string_alloc(path_buf);