- 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
parent c6ea10f03f
commit 7092a0a8f0
2 changed files with 2 additions and 16 deletions

View file

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

View file

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