[physfs] enumerateFiles Regression on Mac OS

Ralph Eastwood tcmreastwood at gmail.com
Sun Oct 16 10:06:36 EDT 2016


Hello,

I made this patch quickly and appears to work against local mount points...
can someone with some time do some tests against other archive mount points?

Cheers,
Ralph

On 16 October 2016 at 07:23, Cheeseness <cheese at cheesetalks.net> wrote:
> Hi hi
>
> I've found some unexpected behaviour with PHYSFS_enumerateFiles() on Mac
> OS 10.10.5 with the current 2.1.0 development branch (as at changeset
> 1384:d844add9a935).
>
> PHYSFS_enumerateFiles() will not list anything mounted outside of /,
> including mounted subdirectories of /.
>
> To reproduce,
>
>   $ mkdir foo; touch foo/bar
>   $ ./test_physfs
>   > mount foo test 1
>   > enumerate test
>
> This will consistently return "total (0) files" with 2.1.0, but with the
> 2.0.3 stable release, "bar" is listed as being within the virtual folder
> "test".
>
> I haven't had time to look through and see if I can work out what's
> going on, but I figured I'd make note of it here in case anybody with
> more familiarity than me has time/enthusiasm enough to take a look
> before I get around to it (it's low on my priority list since I the
> stable build is functional enough for me right now).
>
> Cheese
>
>
> _______________________________________________
> physfs mailing list
> physfs at icculus.org
> http://icculus.org/mailman/listinfo/physfs



-- 
Tai Chi Minh Ralph Eastwood
tcmreastwood at gmail.com
-------------- next part --------------
# HG changeset patch
# User Tai Chi Minh Ralph Eastwood <tcmreastwood at gmail.com>
# Date 1476626473 -3600
#      Sun Oct 16 15:01:13 2016 +0100
# Node ID 308475c53ebd6b2d1966abcd6aeb6330870438f7
# Parent  146019d5d747d984867007aefafb2db484d6c7fc
Fix enumerating on virtual mount point.

diff -r 146019d5d747 -r 308475c53ebd src/physfs.c
--- a/src/physfs.c	Thu Oct 06 15:39:49 2016 -0400
+++ b/src/physfs.c	Sun Oct 16 15:01:13 2016 +0100
@@ -2255,7 +2255,6 @@
     DirHandle *dirhandle;
 } SymlinkFilterData;
 
-/* !!! FIXME: broken if in a virtual mountpoint (stat call fails). */
 static void enumCallbackFilterSymLinks(void *_data, const char *origdir,
                                        const char *fname)
 {
@@ -2266,11 +2265,10 @@
     if (path != NULL)
     {
         SymlinkFilterData *data = (SymlinkFilterData *) _data;
-        const DirHandle *dh = data->dirhandle;
         PHYSFS_Stat statbuf;
 
         sprintf(path, "%s%s%s", trimmedDir, *trimmedDir ? "/" : "", fname);
-        if (dh->funcs->stat(dh->opaque, path, &statbuf))
+        if (PHYSFS_stat(path, &statbuf))
         {
             /* Pass it on to the application if it's not a symlink. */
             if (statbuf.filetype != PHYSFS_FILETYPE_SYMLINK)


More information about the physfs mailing list