Don't set readonly if PHYSFS_stat()'ing something not in the write dir.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 14 Aug 2017 02:46:07 -0400
changeset 1573 6eec1a358f3d
parent 1572 5c091e04ac46
child 1574 87100b3836cd
Don't set readonly if PHYSFS_stat()'ing something not in the write dir.

This API is meant to report what the archivers think about an item and not
actually tell you if a PHYSFS_openWrite() will succeed on it.
src/physfs.c
--- a/src/physfs.c	Mon Aug 14 02:42:13 2017 -0400
+++ b/src/physfs.c	Mon Aug 14 02:46:07 2017 -0400
@@ -3011,9 +3011,6 @@
                 } /* if */
                 else if (verifyPath(i, &arcfname, 0))
                 {
-                    /* !!! FIXME-3.0: this test is wrong and should be elsewhere. */
-                    stat->readonly = !(writeDir &&
-                                 (strcmp(writeDir->dirName, i->dirName) == 0));
                     retval = i->funcs->stat(i->opaque, arcfname, stat);
                     if ((retval) || (currentErrorCode() != PHYSFS_ERR_NOT_FOUND))
                         exists = 1;