mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 09:40:06 +00:00
omit extra slash at end of path, Win95/98 doesn't like them
This commit is contained in:
parent
812a99e5ca
commit
1a928b9c50
@ -103,6 +103,7 @@ struct RDIR *retro_opendir(const char *name)
|
||||
char path_buf[1024];
|
||||
char *path_local = NULL;
|
||||
wchar_t *path_wide = NULL;
|
||||
unsigned path_len;
|
||||
#endif
|
||||
struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir));
|
||||
|
||||
@ -114,7 +115,13 @@ struct RDIR *retro_opendir(const char *name)
|
||||
(void)path_local;
|
||||
|
||||
path_buf[0] = '\0';
|
||||
snprintf(path_buf, sizeof(path_buf), "%s\\*", name);
|
||||
path_len = strlen(name);
|
||||
|
||||
/* Non-NT platforms don't like extra slashes in the path */
|
||||
if (name[path_len - 1] == '\\')
|
||||
snprintf(path_buf, sizeof(path_buf), "%s*", name);
|
||||
else
|
||||
snprintf(path_buf, sizeof(path_buf), "%s\\*", name);
|
||||
#if defined(LEGACY_WIN32)
|
||||
path_local = utf8_to_local_string_alloc(path_buf);
|
||||
rdir->directory = FindFirstFile(path_local, &rdir->entry);
|
||||
|
Loading…
x
Reference in New Issue
Block a user