summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Howard2007-08-08 18:03:32 +0000
committerSimon Howard2007-08-08 18:03:32 +0000
commitff95b3ad95fd25d49e587e9d402cae67bab2e95d (patch)
treec9b6eb43283894477ba9caa053a635b7e39d478a
parent7c2a5dfb1bac2eb0272d027e357229600d077292 (diff)
downloadchocolate-doom-ff95b3ad95fd25d49e587e9d402cae67bab2e95d.tar.gz
chocolate-doom-ff95b3ad95fd25d49e587e9d402cae67bab2e95d.tar.bz2
chocolate-doom-ff95b3ad95fd25d49e587e9d402cae67bab2e95d.zip
Make M_FileExists work on directories.
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 949
-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;
}
}