mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 20:36:38 +02:00
Fix bug with arguments of config_read callback in script plugins
This commit is contained in:
@@ -1088,10 +1088,11 @@ weechat_lua_api_config_new (lua_State *L)
|
||||
void
|
||||
weechat_lua_api_config_read_cb (void *data,
|
||||
struct t_config_file *config_file,
|
||||
struct t_config_section *section,
|
||||
const char *option_name, const char *value)
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *lua_argv[4];
|
||||
char *lua_argv[5];
|
||||
int *rc;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -1099,9 +1100,10 @@ weechat_lua_api_config_read_cb (void *data,
|
||||
if (script_callback->function && script_callback->function[0])
|
||||
{
|
||||
lua_argv[0] = script_ptr2str (config_file);
|
||||
lua_argv[1] = (char *)option_name;
|
||||
lua_argv[2] = (char *)value;
|
||||
lua_argv[3] = NULL;
|
||||
lua_argv[1] = script_ptr2str (section);
|
||||
lua_argv[2] = (char *)option_name;
|
||||
lua_argv[3] = (char *)value;
|
||||
lua_argv[4] = NULL;
|
||||
|
||||
rc = (int *) weechat_lua_exec (script_callback->script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
@@ -1112,6 +1114,8 @@ weechat_lua_api_config_read_cb (void *data,
|
||||
free (rc);
|
||||
if (lua_argv[0])
|
||||
free (lua_argv[0]);
|
||||
if (lua_argv[1])
|
||||
free (lua_argv[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user