Non-existant archives/directories report a more correct error, and a call
authorRyan C. Gordon <icculus@icculus.org>
Mon, 23 Jul 2001 04:46:42 +0000
changeset 44 534901592376
parent 43 8a68085acebf
child 45 a489d28872ba
Non-existant archives/directories report a more correct error, and a call to PHYSFS_exists("") now always succeeds.
physfs.c
--- a/physfs.c	Mon Jul 23 04:45:26 2001 +0000
+++ b/physfs.c	Mon Jul 23 04:46:42 2001 +0000
@@ -189,6 +189,8 @@
 {
     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 @@
     while (*fname == '/')
         fname++;
 
+    if (*fname == '\0')
+        return(1);
+
     for (i = searchPath; i != NULL; i = i->next)
     {
         DirHandle *h = i->dirHandle;