summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/m_misc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/m_misc.c b/src/m_misc.c
index d5bdc5cf..191a45c0 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
+#include <errno.h>
// for mkdir:
@@ -138,7 +139,10 @@ boolean M_FileExists(char *filename)
}
else
{
- return false;
+ // If we can't open because the file is a directory, the
+ // "file" exists at least!
+
+ return errno == EISDIR;
}
}