Enable symlinks by default (resolves issue #1072.)

This commit is contained in:
Alex Szpakowski
2015-09-07 17:10:14 -03:00
parent 4dbc11800e
commit c9c772613c
+13 -6
View File
@@ -125,12 +125,8 @@ void Filesystem::init(const char *arg0)
if (!PHYSFS_init(arg0))
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);
// Enable symlinks by default. Also fixes an issue in PhysFS 2.1-alpha.
setSymlinksEnabled(true);
}
void Filesystem::setFused(bool fused)
@@ -664,6 +660,17 @@ int64 Filesystem::getSize(const char *filename) const
void Filesystem::setSymlinksEnabled(bool enable)
{
if (!enable)
{
PHYSFS_Version version = {};
PHYSFS_getLinkedVersion(&version);
// FIXME: This is a workaround for a bug in PHYSFS_enumerateFiles in
// PhysFS 2.1-alpha.
if (version.major == 2 && version.minor == 1)
return;
}
PHYSFS_permitSymbolicLinks(enable ? 1 : 0);
}