From c2628fe4f9de086602dceac2fad22b29c3fa8afc Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 16 Feb 2015 00:27:17 -0400 Subject: [PATCH] Added a workaround for a bug in PhysFS 2.1-alpha involving trailing slashes and PHYSFS_enumerateFiles. --HG-- branch : minor --- src/modules/filesystem/physfs/Filesystem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 9a764e95c..2f09414c6 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -111,7 +111,14 @@ const char *Filesystem::getName() const void Filesystem::init(const char *arg0) { if (!PHYSFS_init(arg0)) - throw Exception(PHYSFS_getLastError()); + throw love::Exception("%s", PHYSFS_getLastError()); + + PHYSFS_Version version = {}; + PHYSFS_getLinkedVersion(&version); + + // FIXME: This is a workaround for a bug in PHYSFS_enumerateFiles in 2.1-alpha. + if (version.major == 2 && version.minor == 1) + PHYSFS_permitSymbolicLinks(1); } void Filesystem::setFused(bool fused)