mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
Enable symlinks by default (resolves issue #1072.)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user