diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/plugin-api.c | 9 |
1 files changed, 8 insertions, 1 deletions
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) { |