PHYSFS_init() should fail if argv0 is NULL and we can't do without it.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 19 Mar 2007 20:13:37 +0000
changeset 839 cbb9d603ca71
parent 838 257f0f83e012
child 840 7f071b3b121e
PHYSFS_init() should fail if argv0 is NULL and we can't do without it.
physfs.c
--- a/physfs.c	Mon Mar 19 20:12:54 2007 +0000
+++ b/physfs.c	Mon Mar 19 20:13:37 2007 +0000
@@ -662,6 +662,9 @@
     if (retval != NULL)
         return(retval);
 
+    /* we need argv0 to be sane to go on. */
+    BAIL_IF_MACRO(argv0 == NULL, ERR_INVALID_ARGUMENT, NULL);
+
     /*
      * Determine if there's a path on argv0. If there is, that's the base dir.
      */
@@ -684,6 +687,8 @@
         return(retval);
     } /* if */
 
+    /* !!! FIXME: should probably just fail here instead of being heroic. */
+
     /*
      * Last ditch effort: it's the current working directory. (*shrug*)
      */