1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

Return absolute path for info_get of "weechat_dir" (bug #27936)

This commit is contained in:
Sebastien Helleu
2010-03-08 11:21:03 +01:00
parent 682f5addc0
commit 58d423319c
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -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)
+8 -1
View File
@@ -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)
{