changeset 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 135ec7f15ffe
children f4f6734771e0
files srogue/main.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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);
 }