Fix -N option to work with builtin plugins as well.

This commit is contained in:
Robin Sommer 2015-04-23 07:10:36 -07:00
parent 0cc49b8769
commit 7d95ebb48a
3 changed files with 16 additions and 1 deletions

View file

@ -1,4 +1,8 @@
2.3-883 | 2015-04-23 07:10:36 -0700
* Fix -N option to work with builtin plugins as well. (Robin Sommer)
2.3-882 | 2015-04-23 06:59:40 -0700
* Add missing .pac dependencies for some binpac analyzer targets.

View file

@ -1 +1 @@
2.3-882
2.3-883

View file

@ -143,6 +143,17 @@ bool Manager::ActivateDynamicPluginInternal(const std::string& name, bool ok_if_
if ( ok_if_not_found )
return true;
// Check if it's a static built-in plugin; they are always
// active, so just ignore. Not the most efficient way, but
// this should be rare to begin with.
plugin_list* all_plugins = Manager::ActivePluginsInternal();
for ( plugin::Manager::plugin_list::const_iterator i = all_plugins->begin(); i != all_plugins->end(); i++ )
{
if ( (*i)->Name() == name )
return true;
}
reporter->Error("plugin %s is not available", name.c_str());
return false;
}