summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-05-22 12:30:56 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-05-22 12:30:56 +0200
commitec6f2c2e177eb99370a5dc58ce932aeff57f0648 (patch)
tree8c55e5c86f2fc5d074ecf25c6bb1353f1aeebc32 /src
parent59853abbbb82a322d3a60ff1accd70dcc0a04428 (diff)
downloadweechat-ec6f2c2e177eb99370a5dc58ce932aeff57f0648.zip
Fix bug with plugin path when loading with "/plugin load": replace ~ by user home directory
Diffstat (limited to 'src')
-rw-r--r--src/plugins/plugin.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 734385c47..33633a9ce 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -88,7 +88,7 @@ plugin_search (char *name)
struct t_weechat_plugin *
plugin_load (char *filename)
{
- char *full_name;
+ char *ptr_home, *full_name, *full_name2;
void *handle;
char *name, *author, *description, *version, *weechat_version, *license;
char *charset;
@@ -105,6 +105,15 @@ plugin_load (char *filename)
if (!full_name)
return NULL;
+ ptr_home = getenv ("HOME");
+ full_name2 = string_replace (full_name, "~", ptr_home);
+
+ if (full_name2)
+ {
+ free (full_name);
+ full_name = full_name2;
+ }
+
handle = dlopen (full_name, RTLD_GLOBAL | RTLD_NOW);
if (!handle)
{