diff options
Diffstat (limited to 'src/plugins/tcl/weechat-tcl-api.c')
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index 250f3f7f7..2159ec645 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -68,6 +68,8 @@ plugin_script_str2ptr (weechat_tcl_plugin, \ TCL_CURRENT_SCRIPT_NAME, \ tcl_function_name, __string) +#define API_STATIC_STRING(__string) \ + plugin_script_get_static_string(&tcl_data, __string); #define API_RETURN_OK \ { \ objp = Tcl_GetObjResult (interp); \ @@ -3209,7 +3211,7 @@ weechat_tcl_api_hook_info_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[3]; - char empty_arg[1] = { '\0' }; + char empty_arg[1] = { '\0' }, *result; const char *ptr_function, *ptr_data; script = (struct t_plugin_script *)pointer; @@ -3221,10 +3223,12 @@ weechat_tcl_api_hook_info_cb (const void *pointer, void *data, func_argv[1] = (info_name) ? (char *)info_name : empty_arg; func_argv[2] = (arguments) ? (char *)arguments : empty_arg; - return (const char *)weechat_tcl_exec (script, - WEECHAT_SCRIPT_EXEC_STRING, - ptr_function, - "sss", func_argv); + result = (char *)weechat_tcl_exec (script, + WEECHAT_SCRIPT_EXEC_STRING, + ptr_function, + "sss", func_argv); + + return API_STATIC_STRING(result); } return NULL; |