getRealPath uses the write directory if it can't get the real directory
authorBradley Bell <btb@icculus.org>
Sun, 5 Dec 2004 10:56:32 +0000 (10:56 +0000)
committerBradley Bell <btb@icculus.org>
Sun, 5 Dec 2004 10:56:32 +0000 (10:56 +0000)
ChangeLog
include/physfsx.h

index 827d53e..33414d2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-05  Chris Taylor  <c.taylor@student.curtin.edu.au>
+
+       * include/physfsx.h: getRealPath uses the write directory if it
+       can't get the real directory
+
 2004-12-03  Bradley Bell  <btb@icculus.org>
 
        * include/cfile.h, include/physfsx.h: use PATH_MAX for hog
index e3cd98d..09f4006 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: physfsx.h,v 1.6 2004-12-04 04:07:16 btb Exp $ */
+/* $Id: physfsx.h,v 1.7 2004-12-05 10:56:32 btb Exp $ */
 
 /*
  *
@@ -83,7 +83,11 @@ static inline int PHYSFSX_getRealPath(const char *stdPath, char *realPath)
        char *p;
 
        if (!realDir)
-               return 0;
+       {
+               realDir = PHYSFS_getWriteDir();
+               if (!realDir)
+                       return 0;
+       }
 
        strncpy(realPath, realDir, PATH_MAX - 1);
        if (strlen(realPath) >= strlen(sep))