src/physfs_platform_posix.c
changeset 1620 f3459eaad51b
parent 1591 97d3641bfba3
--- a/src/physfs_platform_posix.c	Mon Oct 23 14:58:54 2017 -0400
+++ b/src/physfs_platform_posix.c	Thu Oct 26 14:21:36 2017 -0400
@@ -296,11 +296,11 @@
 } /* __PHYSFS_platformDelete */
 
 
-int __PHYSFS_platformStat(const char *filename, PHYSFS_Stat *st)
+int __PHYSFS_platformStat(const char *fname, PHYSFS_Stat *st, const int follow)
 {
     struct stat statbuf;
-
-    BAIL_IF(lstat(filename, &statbuf) == -1, errcodeFromErrno(), 0);
+    const int rc = follow ? stat(fname, &statbuf) : lstat(fname, &statbuf);
+    BAIL_IF(rc == -1, errcodeFromErrno(), 0);
 
     if (S_ISREG(statbuf.st_mode))
     {
@@ -330,7 +330,7 @@
     st->createtime = statbuf.st_ctime;
     st->accesstime = statbuf.st_atime;
 
-    st->readonly = (access(filename, W_OK) == -1);
+    st->readonly = (access(fname, W_OK) == -1);
     return 1;
 } /* __PHYSFS_platformStat */