From ff95b3ad95fd25d49e587e9d402cae67bab2e95d Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 8 Aug 2007 18:03:32 +0000 Subject: Make M_FileExists work on directories. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 949 --- src/m_misc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 #include #include +#include // 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; } } -- cgit v1.2.3