1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 12:56:37 +02:00

Fix bugs with hook_print function in scripts

This commit is contained in:
Sebastien Helleu
2008-11-29 23:31:28 +01:00
parent 003bc0451e
commit 265a0cf2a1
6 changed files with 11 additions and 0 deletions
@@ -2830,6 +2830,8 @@ weechat_lua_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
lua_argv[0] = script_ptr2str (buffer);
lua_argv[1] = timebuffer;
lua_argv[2] = weechat_string_build_with_exploded (tags, ",");
if (!lua_argv[2])
lua_argv[2] = strdup ("");
lua_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
lua_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
lua_argv[5] = (char *)prefix;
@@ -2362,6 +2362,8 @@ weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
perl_argv[0] = script_ptr2str (buffer);
perl_argv[1] = timebuffer;
perl_argv[2] = weechat_string_build_with_exploded (tags, ",");
if (!perl_argv[2])
perl_argv[2] = strdup ("");
perl_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
perl_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
perl_argv[5] = (char *)prefix;
@@ -2522,6 +2522,8 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
python_argv[0] = script_ptr2str (buffer);
python_argv[1] = timebuffer;
python_argv[2] = weechat_string_build_with_exploded (tags, ",");
if (!python_argv[2])
python_argv[2] = strdup ("");
python_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
python_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
python_argv[5] = (char *)prefix;
@@ -2905,6 +2905,8 @@ weechat_ruby_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
ruby_argv[0] = script_ptr2str (buffer);
ruby_argv[1] = timebuffer;
ruby_argv[2] = weechat_string_build_with_exploded (tags, ",");
if (!ruby_argv[2])
ruby_argv[2] = strdup ("");
ruby_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
ruby_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
ruby_argv[5] = (char *)prefix;
@@ -2734,6 +2734,8 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer,
tcl_argv[0] = script_ptr2str (buffer);
tcl_argv[1] = timebuffer;
tcl_argv[2] = weechat_string_build_with_exploded (tags, ",");
if (!tcl_argv[2])
tcl_argv[2] = strdup ("");
tcl_argv[3] = (displayed) ? strdup ("1") : strdup ("0");
tcl_argv[4] = (highlight) ? strdup ("1") : strdup ("0");
tcl_argv[5] = (char *)prefix;