diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/pglist.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c index c1d96ed..18a2f3f 100644 --- a/src/plugins/pglist.c +++ b/src/plugins/pglist.c @@ -28,6 +28,7 @@ #include <assert.h> #include <dirent.h> #include <malloc.h> +#include <stdlib.h> #include <string.h> @@ -77,6 +78,9 @@ bool init_all_plugins(bool load) #ifdef DISCARD_LOCAL char *edir; /* Répertoire de base effectif */ #endif + char *env; /* Contenu environnemental */ + char *saveptr; /* Sauvegarde pour parcours */ + char *udir; /* Répertoire supplémentaire ? */ g_rw_lock_init(&_pg_lock); @@ -88,6 +92,19 @@ bool init_all_plugins(bool load) free(edir); #endif + env = getenv("CHRYSALIDE_PLUGINS_PATH"); + + if (env != NULL) + { + env = strdup(env); + + for (udir = strtok_r(env, ":", &saveptr); udir != NULL; udir = strtok_r(NULL, ":", &saveptr)) + browse_directory_for_plugins(udir); + + free(env); + + } + if (load) load_remaning_plugins(); |