physfs.c
changeset 100 d2f04ab4b412
parent 93 74d1df359be3
child 101 bd18e17ad6ad
equal deleted inserted replaced
99:5a5a0d60cbf1 100:d2f04ab4b412
   338     } /* if */
   338     } /* if */
   339 
   339 
   340     /*
   340     /*
   341      * Last ditch effort: it's the current working directory. (*shrug*)
   341      * Last ditch effort: it's the current working directory. (*shrug*)
   342      */
   342      */
   343     return(__PHYSFS_platformCurrentDir());
   343     retval = __PHYSFS_platformCurrentDir();
       
   344     if(retval != NULL) {
       
   345 	return(retval);
       
   346     }
       
   347 
       
   348     /*
       
   349      * Ok, current directory doesn't exist, use the root directory.
       
   350      * Not a good alternative, but it only happens if the current
       
   351      * directory was deleted from under the program.
       
   352      */
       
   353     retval = (char *) malloc(strlen(dirsep) + 1);
       
   354     strcpy(retval, dirsep);
       
   355     return(retval);
   344 } /* calculateBaseDir */
   356 } /* calculateBaseDir */
   345 
   357 
   346 
   358 
   347 int PHYSFS_init(const char *argv0)
   359 int PHYSFS_init(const char *argv0)
   348 {
   360 {