summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/plugins/plugin-api.c9
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index ae46f6028..38f303575 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
FlashCode <flashcode@flashtux.org>
-v0.3.2-dev, 2010-03-07
+v0.3.2-dev, 2010-03-08
Version 0.3.2 (under dev!)
@@ -35,6 +35,7 @@ Version 0.3.2 (under dev!)
* api: fix function "color" in Lua script API
* api: fix "inactivity" value when no key has been pressed since WeeChat started
(bug #28930)
+* api: return absolute path for info_get of "weechat_dir" (bug #27936)
* scripts: allow script commands to reload only one script
* perl: fix crash when callbacks are called during script initialization
(bug #29018)
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index 4e4679a61..48212cb60 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -24,6 +24,7 @@
#endif
#include <errno.h>
+#include <limits.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
@@ -260,6 +261,7 @@ plugin_api_info_get_internal (void *data, const char *info_name,
{
time_t inactivity;
static char value[32], version_number[32] = { '\0' };
+ static char weechat_dir_absolute_path[PATH_MAX] = { '\0' };
/* make C compiler happy */
(void) data;
@@ -291,7 +293,12 @@ plugin_api_info_get_internal (void *data, const char *info_name,
}
else if (string_strcasecmp (info_name, "weechat_dir") == 0)
{
- return weechat_home;
+ if (!weechat_dir_absolute_path[0])
+ {
+ realpath (weechat_home, weechat_dir_absolute_path);
+ }
+ return (weechat_dir_absolute_path[0]) ?
+ weechat_dir_absolute_path : weechat_home;
}
else if (string_strcasecmp (info_name, "weechat_libdir") == 0)
{