summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/python/weechat-python-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-02-19 14:12:18 +0100
committerSebastien Helleu <flashcode@flashtux.org>2009-02-19 14:12:18 +0100
commit78fe938e4f4c18eeac64b50b9858aec40e7f85b2 (patch)
treeb1faae8dfc04378f1d6434c7b98f34e99992bd34 /src/plugins/scripts/python/weechat-python-api.c
parent0ca39f974b6419ca9a428d2f8cde72ee20a3f8c0 (diff)
downloadweechat-78fe938e4f4c18eeac64b50b9858aec40e7f85b2.zip
Fix bug with arguments of config_read callback in script plugins
Diffstat (limited to 'src/plugins/scripts/python/weechat-python-api.c')
-rw-r--r--src/plugins/scripts/python/weechat-python-api.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c
index 9cf06796b..0848cf284 100644
--- a/src/plugins/scripts/python/weechat-python-api.c
+++ b/src/plugins/scripts/python/weechat-python-api.c
@@ -952,10 +952,11 @@ weechat_python_api_config_new (PyObject *self, PyObject *args)
void
weechat_python_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 *python_argv[4];
+ char *python_argv[5];
int *rc;
script_callback = (struct t_script_callback *)data;
@@ -963,9 +964,10 @@ weechat_python_api_config_read_cb (void *data,
if (script_callback->function && script_callback->function[0])
{
python_argv[0] = script_ptr2str (config_file);
- python_argv[1] = (char *)option_name;
- python_argv[2] = (char *)value;
- python_argv[3] = NULL;
+ python_argv[1] = script_ptr2str (section);
+ python_argv[2] = (char *)option_name;
+ python_argv[3] = (char *)value;
+ python_argv[4] = NULL;
rc = (int *) weechat_python_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
@@ -976,6 +978,8 @@ weechat_python_api_config_read_cb (void *data,
free (rc);
if (python_argv[0])
free (python_argv[0]);
+ if (python_argv[1])
+ free (python_argv[1]);
}
}