From 572812085d0e2ecb39ad3139f4925aaab09b10e1 Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 4 Jul 2007 11:26:10 +0000 Subject: [PATCH] cosmetics on the plugin loader git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@376 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmPlugIn.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/core/AmPlugIn.cpp b/core/AmPlugIn.cpp index a63ef36f..28721dce 100644 --- a/core/AmPlugIn.cpp +++ b/core/AmPlugIn.cpp @@ -30,6 +30,7 @@ #include "AmConfig.h" #include "AmApi.h" #include "AmInterfaceHandler.h" +#include "AmUtils.h" #include "amci/amci.h" #include "amci/codecs.h" @@ -148,14 +149,12 @@ int AmPlugIn::load(const string& directory, const string& plugins) } else { DBG("AmPlugIn: loading modules '%s':\n", plugins.c_str()); - size_t pos = 0; - - while (pos < plugins.length()) { - size_t pos2 = plugins.find(";", pos); - if (pos2 == string::npos) - pos2 = plugins.length(); - string plugin_file = plugins.substr(pos, pos2-pos); - if( plugin_file.find(".so",plugin_file.length()-3) == string::npos ) + vector plugins_list = explode(plugins, ";"); + for (vector::iterator it = plugins_list.begin(); + it != plugins_list.end(); it++) { + string plugin_file = *it; + if(plugin_file.find(".so",plugin_file.length()-3) + == string::npos ) plugin_file+=".so"; plugin_file = directory + "/" + plugin_file; @@ -165,11 +164,6 @@ int AmPlugIn::load(const string& directory, const string& plugins) // be strict here: if plugin not loaded, stop! return err; } - if (plugins[pos2]==';') - pos = pos2+1; - else - break; - } } closedir(dir);