diff srogue/main.c @ 189:7c552cbc6ad9

srogue: make checking directories slightly more portable. MSVC sys/stat.h doesn't define S_ISDIR().
author John "Elwin" Edwards
date Mon, 03 Aug 2015 09:05:15 -0400
parents db1c9a21a7c3
children 3de8058dd549
line wrap: on
line diff
--- a/srogue/main.c	Mon Aug 03 07:04:48 2015 -0400
+++ b/srogue/main.c	Mon Aug 03 09:05:15 2015 -0400
@@ -438,7 +438,7 @@
     struct stat sb;
 
     if (stat(dirname, &sb) == 0) /* path exists */
-        return (S_ISDIR (sb.st_mode));
+        return ((sb.st_mode & S_IFMT) == S_IFDIR);
 
     return(0);
 }