VFS: Fix Windows build
Jeffrey Pfau jeffrey@endrift.com
Tue, 25 Aug 2015 23:28:52 -0700
1 files changed,
5 insertions(+),
1 deletions(-)
jump to
M
src/util/vfs/vfs-dirent.c
→
src/util/vfs/vfs-dirent.c
@@ -8,6 +8,7 @@
#include "util/string.h" #include <dirent.h> +#include <sys/stat.h> static bool _vdClose(struct VDir* vd); static void _vdRewind(struct VDir* vd);@@ -17,8 +18,10 @@
static const char* _vdeName(struct VDirEntry* vde); static enum VFSType _vdeType(struct VDirEntry* vde); +struct VDirDE; struct VDirEntryDE { struct VDirEntry d; + struct VDirDE* p; struct dirent* ent; };@@ -50,6 +53,7 @@ vd->de = de;
vd->vde.d.name = _vdeName; vd->vde.d.type = _vdeType; + vd->vde.p = vd; return &vd->d; }@@ -201,7 +205,7 @@ return VFS_DIRECTORY;
} return VFS_FILE; #else - const char* dir = vdde->path; + const char* dir = vdede->p->path; char* combined = malloc(sizeof(char) * (strlen(vdede->ent->d_name) + strlen(dir) + 2)); sprintf(combined, "%s%s%s", dir, PATH_SEP, vdede->ent->d_name); struct stat sb;