summaryrefslogtreecommitdiff
path: root/libpurple/plugins.c
diff options
context:
space:
mode:
authorMike Ruprecht <cmaiku@gmail.com>2015-12-31 02:33:19 -0600
committerMike Ruprecht <cmaiku@gmail.com>2015-12-31 02:33:19 -0600
commit08da631a3550cadf41c6e2fb29d89056bf835cc0 (patch)
treed0bd54cb52f5c6fb56498dd70834c18b63cfc408 /libpurple/plugins.c
parent4b842adf0a27f621b79f80e2329dc7ddccc1dc6c (diff)
downloadpidgin-08da631a3550cadf41c6e2fb29d89056bf835cc0.tar.gz
Add PURPLE_PLUGIN_PATH environment variable
This allows plugins in arbitrary paths to be loaded.
Diffstat (limited to 'libpurple/plugins.c')
-rw-r--r--libpurple/plugins.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libpurple/plugins.c b/libpurple/plugins.c
index 534e4011b2..152a935630 100644
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -1108,6 +1108,9 @@ void
purple_plugins_init(void)
{
void *handle = purple_plugins_get_handle();
+#ifdef PURPLE_PLUGINS
+ const gchar *search_path;
+#endif
purple_signal_register(handle, "plugin-load",
purple_marshal_VOID__POINTER,
@@ -1118,6 +1121,20 @@ purple_plugins_init(void)
#ifdef PURPLE_PLUGINS
gplugin_init();
+
+ search_path = g_getenv("PURPLE_PLUGIN_PATH");
+ if (search_path) {
+ gchar **paths;
+ int i;
+
+ paths = g_strsplit(search_path, G_SEARCHPATH_SEPARATOR_S, 0);
+ for (i = 0; paths[i]; ++i) {
+ purple_plugins_add_search_path(paths[i]);
+ }
+
+ g_strfreev(paths);
+ }
+
gplugin_manager_add_default_paths();
purple_plugins_add_search_path(PURPLE_LIBDIR);