summaryrefslogtreecommitdiff
path: root/plugins.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins.c')
-rw-r--r--plugins.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins.c b/plugins.c
index d41b0777..a83fb64c 100644
--- a/plugins.c
+++ b/plugins.c
@@ -779,6 +779,14 @@ plug_load_all (void) {
// load from HOME 1st, than replace from installdir if needed
const char *plugins_dirs[] = { xdg_plugin_dir, dirname, NULL };
+
+ // If xdg_plugin_dir and dirname is the same, we should avoid each plugin
+ // to be load twice.
+ // XXX: Here absolute path is assumed, however if dirname is a relative
+ // path it won't work.
+ if (strcmp(xdg_plugin_dir, dirname) == 0) {
+ plugins_dirs[1] = NULL;
+ }
#else
const char *plugins_dirs[] = { dirname, NULL };
#endif