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

Add return code value for config_read callback in script plugins

This commit is contained in:
Sebastien Helleu
2009-02-20 14:53:32 +01:00
parent e3f12be462
commit 1b4028218c
7 changed files with 75 additions and 27 deletions
+12 -3
View File
@@ -1085,7 +1085,7 @@ weechat_lua_api_config_new (lua_State *L)
* weechat_lua_api_config_read_cb: callback for reading option in section
*/
void
int
weechat_lua_api_config_read_cb (void *data,
struct t_config_file *config_file,
struct t_config_section *section,
@@ -1093,7 +1093,7 @@ weechat_lua_api_config_read_cb (void *data,
{
struct t_script_callback *script_callback;
char *lua_argv[5];
int *rc;
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@@ -1110,13 +1110,22 @@ weechat_lua_api_config_read_cb (void *data,
script_callback->function,
lua_argv);
if (rc)
if (!rc)
ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
else
{
ret = *rc;
free (rc);
}
if (lua_argv[0])
free (lua_argv[0]);
if (lua_argv[1])
free (lua_argv[1]);
return ret;
}
return WEECHAT_CONFIG_OPTION_SET_ERROR;
}
/*