mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- 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:
parent
c6ea10f03f
commit
7092a0a8f0
2 changed files with 2 additions and 16 deletions
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue