From bf2508c6d619b6268868914f3cad82184c8817a6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 23 Jul 2001 04:46:42 +0000 Subject: [PATCH] Non-existant archives/directories report a more correct error, and a call to PHYSFS_exists("") now always succeeds. --- physfs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/physfs.c b/physfs.c index cc6377c..1944a9d 100644 --- a/physfs.c +++ b/physfs.c @@ -189,6 +189,8 @@ static DirHandle *openDirectory(const char *d, int forWriting) { const DirFunctions **i; + BAIL_IF_MACRO(!__PHYSFS_platformExists(d), ERR_NO_SUCH_FILE, NULL); + for (i = dirFunctions; *i != NULL; i++) { if ((*i)->isArchive(d, forWriting)) @@ -1058,6 +1060,9 @@ int PHYSFS_isDirectory(const char *fname) while (*fname == '/') fname++; + if (*fname == '\0') + return(1); + for (i = searchPath; i != NULL; i = i->next) { DirHandle *h = i->dirHandle;