Core/DynLib: Fix extension handling

This commit is contained in:
Jérôme Leclercq
2022-03-20 13:42:41 +01:00
parent 2b53ca6101
commit 48b87cc99b
4 changed files with 8 additions and 13 deletions

View File

@@ -45,12 +45,8 @@ namespace Nz
bool DynLibImpl::Load(const std::filesystem::path& libraryPath, std::string* errorMessage)
{
std::filesystem::path path = libraryPath;
if (path.extension() != ".so")
path += ".so";
dlerror(); // Clear error flag
m_handle = dlopen(path.generic_u8string().data(), RTLD_LAZY | RTLD_GLOBAL);
m_handle = dlopen(libraryPath.generic_u8string().data(), RTLD_LAZY | RTLD_GLOBAL);
if (m_handle)
return true;