r851 - trunk

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Mar 19 16:13:37 EDT 2007


Author: icculus
Date: 2007-03-19 16:13:37 -0400 (Mon, 19 Mar 2007)
New Revision: 851

Modified:
   trunk/physfs.c
Log:
PHYSFS_init() should fail if argv0 is NULL and we can't do without it.


Modified: trunk/physfs.c
===================================================================
--- trunk/physfs.c	2007-03-19 20:12:54 UTC (rev 850)
+++ trunk/physfs.c	2007-03-19 20:13:37 UTC (rev 851)
@@ -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*)
      */




More information about the physfs-commits mailing list