Use dirent d_type when available instead of accessing FsDirectoryEntry.

This commit is contained in:
yellows8 2019-09-30 17:58:30 -04:00
parent 793b912efd
commit 97ab367379
No known key found for this signature in database
GPG Key ID: 0AF90DA3F1E60E43

View File

@ -176,11 +176,10 @@ int menuScan(const char* target) {
memset(tmp_path, 0, sizeof(tmp_path));
snprintf(tmp_path, sizeof(tmp_path)-1, "%s%s%s", s_menu[!s_curMenu].dirname, dirsep, dp->d_name);
#ifdef __SWITCH__
fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct;
FsDirectoryEntry* entry = &dirSt->entry_data[dirSt->index];
entrytype = entry->type == ENTRYTYPE_DIR;
#ifdef _DIRENT_HAVE_D_TYPE
if (dp->d_type == DT_UNKNOWN)
continue;
entrytype = dp->d_type != DT_REG;
#else
struct stat tmpstat;