From 77c69b721f997141584a92e10af40e06f0c5777d Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 16 Dec 2020 13:43:19 +0100 Subject: [PATCH] included libscerror header for throw macros; now honours extension --- plugin.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin.hpp b/plugin.hpp index 82a39fd..0c56cf6 100644 --- a/plugin.hpp +++ b/plugin.hpp @@ -14,9 +14,9 @@ #include #include #include - #include #include +#include namespace sc { @@ -32,10 +32,9 @@ namespace sc { std::string plugname {info->d_name}; std::string::size_type lastdot = plugname.rfind("."); if (plugname.substr(lastdot + 1) == ext) { - + plugin plugin {dir + '/' + plugname}; + plugins.emplace(plugname.substr(0, lastdot), std::move(plugin)); } - plugin plugin {dir + '/' + plugname}; - plugins.emplace(plugname.substr(0, lastdot), std::move(plugin)); } } throw_if_min1(::closedir(plugins_dir)); @@ -62,6 +61,7 @@ namespace sc { plugin(const std::string& path) : _path {path} { _plugin = ::dlopen(path.c_str(), RTLD_LAZY); + //std::cerr << path << (_plugin ? "" : " not") << " opened\n"; const char* err {::dlerror()}; if (err) std::cerr << err << '\n';