1
0
mirror of https://github.com/libretro/RetroArch synced 2025-03-25 07:43:52 +00:00

Change back retro_dirent_is_dir to hopefully avoid sshfs issues

- more rigorous testing should be applied before changing these
functions
This commit is contained in:
twinaphex 2016-05-11 18:54:22 +02:00
parent fc56f6ebdb
commit 377f09f12a
3 changed files with 3 additions and 6 deletions
libretro-common

@ -158,7 +158,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir)
* Returns: true if directory listing entry is
* a directory, false if not.
*/
bool retro_dirent_is_dir(struct RDIR *rdir)
bool retro_dirent_is_dir(struct RDIR *rdir, const char *path)
{
#if defined(_WIN32)
const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry;
@ -174,18 +174,15 @@ bool retro_dirent_is_dir(struct RDIR *rdir)
CellFsDirent *entry = (CellFsDirent*)&rdir->entry;
return (entry->d_type == CELL_FS_TYPE_DIRECTORY);
#elif defined(DT_DIR)
const char *path = NULL;
const struct dirent *entry = (const struct dirent*)rdir->entry;
if (entry->d_type == DT_DIR)
return true;
/* This can happen on certain file systems. */
path = retro_dirent_get_name(rdir);
if (entry->d_type == DT_UNKNOWN || entry->d_type == DT_LNK)
return path_is_directory(path);
return false;
#else
/* dirent struct doesn't have d_type, do it the slow way ... */
const char *path = retro_dirent_get_name(rdir);
return path_is_directory(path);
#endif
}

@ -49,7 +49,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir);
* Returns: true if directory listing entry is
* a directory, false if not.
*/
bool retro_dirent_is_dir(struct RDIR *rdir);
bool retro_dirent_is_dir(struct RDIR *rdir, const char *path);
void retro_closedir(struct RDIR *rdir);

@ -188,7 +188,7 @@ struct string_list *dir_list_new(const char *dir,
const char *file_ext = path_get_extension(name);
fill_pathname_join(file_path, dir, name, sizeof(file_path));
is_dir = retro_dirent_is_dir(entry);
is_dir = retro_dirent_is_dir(entry, file_path);
ret = parse_dir_entry(name, file_path, is_dir,
include_dirs, include_compressed, list, ext_list, file_ext);