Browse Source

Added a workaround for a bug in PhysFS 2.1-alpha involving trailing slashes and PHYSFS_enumerateFiles.

--HG--
branch : minor
Alex Szpakowski 10 years ago
parent
commit
c2628fe4f9
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/modules/filesystem/physfs/Filesystem.cpp

+ 8 - 1
src/modules/filesystem/physfs/Filesystem.cpp

@@ -111,7 +111,14 @@ const char *Filesystem::getName() const
 void Filesystem::init(const char *arg0)
 void Filesystem::init(const char *arg0)
 {
 {
 	if (!PHYSFS_init(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)
 void Filesystem::setFused(bool fused)