From d747badc25010216f366c862e4c931f26ad38dd0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 25 Aug 2015 23:28:52 -0700 Subject: [PATCH] VFS: Fix Windows build --- src/util/vfs/vfs-dirent.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/vfs/vfs-dirent.c b/src/util/vfs/vfs-dirent.c index d18a7195a..80662a092 100644 --- a/src/util/vfs/vfs-dirent.c +++ b/src/util/vfs/vfs-dirent.c @@ -8,6 +8,7 @@ #include "util/string.h" #include +#include static bool _vdClose(struct VDir* vd); static void _vdRewind(struct VDir* vd); @@ -17,8 +18,10 @@ static struct VFile* _vdOpenFile(struct VDir* vd, const char* path, int mode); 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 @@ struct VDir* VDirOpen(const char* path) { vd->vde.d.name = _vdeName; vd->vde.d.type = _vdeType; + vd->vde.p = vd; return &vd->d; } @@ -201,7 +205,7 @@ static enum VFSType _vdeType(struct VDirEntry* vde) { } 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;