VFS: Fix directory node listing on some filesystems
Vicki Pfau vi@endrift.com
Wed, 05 Aug 2020 21:56:38 -0700
2 files changed,
5 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -33,6 +33,7 @@ - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)
- Qt: Fix static compilation in MinGW (fixes mgba.io/i/1769) - Qt: Fix a race condition in the frame inspector - SM83: Simplify register pair access on big endian + - VFS: Fix directory node listing on some filesystems Misc: - 3DS: Use "wide mode" where applicable for slightly better filtering - GB: Allow pausing event loop while CPU is blocked
M
src/util/vfs/vfs-dirent.c
→
src/util/vfs/vfs-dirent.c
@@ -151,9 +151,10 @@ struct VDirEntryDE* vdede = (struct VDirEntryDE*) vde;
#if !defined(WIN32) && !defined(__HAIKU__) if (vdede->ent->d_type == DT_DIR) { return VFS_DIRECTORY; + } else if (vdede->ent->d_type == DT_REG) { + return VFS_FILE; } - return VFS_FILE; -#else +#endif const char* dir = vdede->p->path; char* combined = malloc(sizeof(char) * (strlen(vdede->ent->d_name) + strlen(dir) + 2)); sprintf(combined, "%s%s%s", dir, PATH_SEP, vdede->ent->d_name);@@ -165,9 +166,8 @@ if (S_ISDIR(sb.st_mode)) {
return VFS_DIRECTORY; } return VFS_FILE; -#endif } bool VDirCreate(const char* path) { return mkdir(path, 0777) == 0 || errno == EEXIST; -}+}