Skip to content
Permalink
Browse files

- 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
  • Loading branch information
alexey-lysiuk committed Jan 12, 2020
1 parent c6ea10f commit 7092a0a8f07c0ad6dd096294e7a170663e7378a9
Showing with 2 additions and 16 deletions.
  1. +1 −8 src/posix/cocoa/i_system.mm
  2. +1 −8 src/posix/sdl/i_system.cpp
@@ -252,14 +252,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;
}


@@ -352,14 +352,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)

0 comments on commit 7092a0a

Please sign in to comment.
You can’t perform that action at this time.