mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 12:26:40 +02:00
scripts: fix return value of hook_infolist callback (pointer instead of string)
This commit is contained in:
@@ -3124,7 +3124,7 @@ weechat_lua_api_hook_infolist_cb (const void *pointer, void *data,
|
||||
|
||||
result = (struct t_infolist *)weechat_lua_exec (
|
||||
script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
WEECHAT_SCRIPT_EXEC_POINTER,
|
||||
ptr_function,
|
||||
"ssss", func_argv);
|
||||
|
||||
|
||||
@@ -346,6 +346,24 @@ weechat_lua_exec (struct t_plugin_script *script, int ret_type,
|
||||
function);
|
||||
}
|
||||
}
|
||||
else if (ret_type == WEECHAT_SCRIPT_EXEC_POINTER)
|
||||
{
|
||||
ret_value = (char *) lua_tostring (lua_current_interpreter, -1);
|
||||
if (ret_value)
|
||||
{
|
||||
ret_value = plugin_script_str2ptr (weechat_lua_plugin,
|
||||
script->name, function,
|
||||
ret_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"%s\" must "
|
||||
"return a valid value"),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME,
|
||||
function);
|
||||
}
|
||||
}
|
||||
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
|
||||
{
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
|
||||
Reference in New Issue
Block a user