- fixed Linux and macOS implementations of I_FindAttr()

At the moment, we assume that dirent struct has d_type member, and DT_DIR is defined
This is true for supported versions of macOS, and Linux with glibc

https://forum.zdoom.org/viewtopic.php?t=66945
This commit is contained in:
alexey.lysiuk 2020-01-12 23:03:59 +02:00 committed by drfrag
parent 07bc5d233e
commit 8a0581481b
2 changed files with 2 additions and 16 deletions

View file

@ -254,14 +254,7 @@ int I_FindClose(void* const handle)
int I_FindAttr(findstate_t* const fileinfo)
{
dirent* const ent = fileinfo->namelist[fileinfo->current];
bool isdir;
if (DirEntryExists(ent->d_name, &isdir))
{
return isdir ? FA_DIREC : 0;
}
return 0;
return (ent->d_type & DT_DIR) ? FA_DIREC : 0;
}

View file

@ -366,14 +366,7 @@ int I_FindClose (void *handle)
int I_FindAttr(findstate_t* const fileinfo)
{
dirent* const ent = fileinfo->namelist[fileinfo->current];
bool isdir;
if (DirEntryExists(ent->d_name, &isdir))
{
return isdir ? FA_DIREC : 0;
}
return 0;
return (ent->d_type & DT_DIR) ? FA_DIREC : 0;
}
void I_PutInClipboard (const char *str)