summaryrefslogtreecommitdiffstats
path: root/lib/MiddleWare
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MiddleWare')
-rw-r--r--lib/MiddleWare/Plugin.h3
-rw-r--r--lib/MiddleWare/PluginManager.cpp11
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/MiddleWare/Plugin.h b/lib/MiddleWare/Plugin.h
index 210e94d8..014733d8 100644
--- a/lib/MiddleWare/Plugin.h
+++ b/lib/MiddleWare/Plugin.h
@@ -30,7 +30,8 @@
#define PLUGINS_MAGIC_NUMBER 1
#define PLUGINS_CONF_EXTENSION "conf"
-#define PLUGINS_LIB_EXTENSIONS "so"
+#define PLUGINS_LIB_EXTENSION "so"
+#define PLUGINS_LIB_PREFIX "lib"
class CPlugin
{
diff --git a/lib/MiddleWare/PluginManager.cpp b/lib/MiddleWare/PluginManager.cpp
index 7d8eb4ef..e0def74a 100644
--- a/lib/MiddleWare/PluginManager.cpp
+++ b/lib/MiddleWare/PluginManager.cpp
@@ -37,7 +37,7 @@ CPluginManager::~CPluginManager()
void CPluginManager::LoadPlugins()
{
- DIR *dir = opendir(m_sPlugisConfDir.c_str());
+ DIR *dir = opendir(m_sPlugisLibDir.c_str());
struct dirent *dent = NULL;
if (dir != NULL)
{
@@ -46,10 +46,11 @@ void CPluginManager::LoadPlugins()
if (dent->d_type == DT_REG)
{
std::string name = dent->d_name;
- std::string extension = name.substr(name.length()-sizeof(PLUGINS_CONF_EXTENSION)+1);
- if (extension == PLUGINS_CONF_EXTENSION)
+ std::string extension = name.substr(name.length()-sizeof(PLUGINS_LIB_EXTENSION)+1);
+ if (extension == PLUGINS_LIB_EXTENSION)
{
- name.erase(name.length()-sizeof(PLUGINS_CONF_EXTENSION));
+ name.erase(0, sizeof(PLUGINS_LIB_PREFIX) - 1);
+ name.erase(name.length() - sizeof(PLUGINS_LIB_EXTENSION));
LoadPlugin(name);
}
}
@@ -75,7 +76,7 @@ void CPluginManager::LoadPlugin(const std::string& pName)
CABRTPlugin* abrtPlugin = NULL;
try
{
- std::string libPath = m_sPlugisLibDir + "/lib" + pName + "." + PLUGINS_LIB_EXTENSIONS;
+ std::string libPath = m_sPlugisLibDir + "/" + PLUGINS_LIB_PREFIX + pName + "." + PLUGINS_LIB_EXTENSION;
abrtPlugin = new CABRTPlugin(libPath);
if (abrtPlugin->GetMagicNumber() != PLUGINS_MAGIC_NUMBER ||
(abrtPlugin->GetType() < LANGUAGE && abrtPlugin->GetType() > DATABASE))