fixed directory check to use POSIX macros
authorHolger Schemel <info@artsoft.org>
Fri, 26 Jun 2015 07:57:19 +0000 (09:57 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 26 Jun 2015 07:57:19 +0000 (09:57 +0200)
src/libgame/misc.c

index cf387ceb9234585a7ea7a2ed850ddffc3d85fb0e..c568159d41d4adf5c43781c4d2afa40f9f62ba19 100644 (file)
@@ -2400,7 +2400,7 @@ DirectoryEntry *readDirectory(Directory *dir)
 
   dir->dir_entry->is_directory =
     (stat(dir->dir_entry->filename, &file_status) == 0 &&
-     (file_status.st_mode & S_IFMT) == S_IFDIR);
+     S_ISDIR(file_status.st_mode));
 
   return dir->dir_entry;
 }
@@ -2427,7 +2427,7 @@ boolean directoryExists(char *dir_name)
 
   struct stat file_status;
   boolean success = (stat(dir_name, &file_status) == 0 &&
-                    (file_status.st_mode & S_IFMT) == S_IFDIR);
+                    S_ISDIR(file_status.st_mode));
 
 #if defined(PLATFORM_ANDROID)
   if (!success)