summaryrefslogtreecommitdiff
path: root/src/plugins/plugin.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-04-17 20:05:58 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-05-11 21:06:13 +0200
commitf923524a21fe1b016d1921e576796ea588706563 (patch)
tree1f896a627e335ee3cd563362c64157f665d64929 /src/plugins/plugin.c
parente5d18e1221b7f232822f0110d80f042ab3bb708e (diff)
downloadweechat-f923524a21fe1b016d1921e576796ea588706563.zip
core: evaluate option weechat.plugin.path (issue #1285)
Diffstat (limited to 'src/plugins/plugin.c')
-rw-r--r--src/plugins/plugin.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index ee5539da8..58dd23ad6 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -1011,7 +1011,7 @@ plugin_auto_load (char *force_plugin_autoload,
int load_from_lib_dir,
int argc, char **argv)
{
- char *dir_name, *plugin_path, *plugin_path2, *extra_libdir;
+ char *dir_name, *plugin_path, *extra_libdir;
const char *ptr_plugin_autoload;
struct t_weechat_plugin *ptr_plugin;
struct t_plugin_args plugin_args;
@@ -1045,20 +1045,14 @@ plugin_auto_load (char *force_plugin_autoload,
&& CONFIG_STRING(config_plugin_path)
&& CONFIG_STRING(config_plugin_path)[0])
{
- plugin_path = string_expand_home (CONFIG_STRING(config_plugin_path));
- plugin_path2 = string_replace ((plugin_path) ?
- plugin_path : CONFIG_STRING(config_plugin_path),
- "%h", weechat_home);
- util_exec_on_files ((plugin_path2) ?
- plugin_path2 : ((plugin_path) ?
- plugin_path : CONFIG_STRING(config_plugin_path)),
- 1,
- 0,
- &plugin_auto_load_file, &plugin_args);
+ plugin_path = string_eval_path_home (CONFIG_STRING(config_plugin_path),
+ NULL, NULL, NULL);
if (plugin_path)
+ {
+ util_exec_on_files (plugin_path, 1, 0,
+ &plugin_auto_load_file, &plugin_args);
free (plugin_path);
- if (plugin_path2)
- free (plugin_path2);
+ }
}
/* auto-load plugins in WEECHAT_EXTRA_LIBDIR environment variable */