]> git.jsancho.org Git - lugaru.git/commitdiff
Fixed writing to prefpath.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 9 Aug 2005 01:20:31 +0000 (01:20 +0000)
committerRyan C. Gordon <icculus@icculus.org>
Tue, 9 Aug 2005 01:20:31 +0000 (01:20 +0000)
Source/MacCompatibility.cpp

index 8e0cae91740f935f447df1d23ee72b51d4476d3e..e1226b608dc32edd854176e8d7b2bd56888b3257 100644 (file)
@@ -242,7 +242,7 @@ static int locateCorrectFile(char *buf, const char *mode)
     snprintf(prefpathfile, len, "%s/%s", prefpath, buf);
 
     int rc = locateCorrectCase(prefpathfile, iswriting);  /* favor prefpath. */
-    if (rc == 0)  // found?
+    if ( (rc == 0) || ((rc == -1) && (iswriting)) ) // found or create?
         strcpy(buf, prefpathfile);
     else if ((rc < 0) && (!iswriting))  /* not writing? Try game dir... */
         rc = locateCorrectCase(buf, iswriting);