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

scripts: fix return value of hook_infolist callback (pointer instead of string)

This commit is contained in:
Sébastien Helleu
2018-04-12 00:12:20 +02:00
parent 5ae557fa52
commit 41d63511b4
18 changed files with 129 additions and 10 deletions
+1 -1
View File
@@ -2930,7 +2930,7 @@ weechat_php_api_hook_infolist_cb (const void *pointer, void *data,
func_argv[3] = (arguments) ? (char *)arguments : weechat_php_empty_arg;
weechat_php_cb (pointer, data, func_argv, "ssss",
WEECHAT_SCRIPT_EXEC_STRING, &rc);
WEECHAT_SCRIPT_EXEC_POINTER, &rc);
return rc;
}
+7
View File
@@ -589,6 +589,13 @@ weechat_php_exec (struct t_plugin_script *script, int ret_type,
convert_to_string (&zretval);
ret_value = strdup ((char *)Z_STRVAL(zretval));
}
else if (ret_type == WEECHAT_SCRIPT_EXEC_POINTER)
{
convert_to_string (&zretval);
ret_value = plugin_script_str2ptr (weechat_php_plugin,
script->name, function,
(char *)Z_STRVAL(zretval));
}
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
{
convert_to_long (&zretval);