Use dirent d_type when available instead of accessing FsDirectoryEntry.
This commit is contained in:
parent
793b912efd
commit
97ab367379
@ -176,11 +176,10 @@ int menuScan(const char* target) {
|
|||||||
memset(tmp_path, 0, sizeof(tmp_path));
|
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);
|
snprintf(tmp_path, sizeof(tmp_path)-1, "%s%s%s", s_menu[!s_curMenu].dirname, dirsep, dp->d_name);
|
||||||
|
|
||||||
#ifdef __SWITCH__
|
#ifdef _DIRENT_HAVE_D_TYPE
|
||||||
fsdev_dir_t* dirSt = (fsdev_dir_t*)dir->dirData->dirStruct;
|
if (dp->d_type == DT_UNKNOWN)
|
||||||
FsDirectoryEntry* entry = &dirSt->entry_data[dirSt->index];
|
continue;
|
||||||
|
entrytype = dp->d_type != DT_REG;
|
||||||
entrytype = entry->type == ENTRYTYPE_DIR;
|
|
||||||
#else
|
#else
|
||||||
struct stat tmpstat;
|
struct stat tmpstat;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user