srogue: make checking directories slightly more portable.

MSVC sys/stat.h doesn't define S_ISDIR().
This commit is contained in:
John "Elwin" Edwards 2015-08-03 09:05:15 -04:00
parent 214c2f6608
commit e857a2cec6

View file

@ -438,7 +438,7 @@ directory_exists(char *dirname)
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);
}