summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/ruby/weechat-ruby-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/ruby/weechat-ruby-api.c')
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby-api.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c
index 72845827a..4c3595148 100644
--- a/src/plugins/scripts/ruby/weechat-ruby-api.c
+++ b/src/plugins/scripts/ruby/weechat-ruby-api.c
@@ -1082,7 +1082,7 @@ weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function)
* weechat_ruby_api_config_read_cb: callback for reading option in section
*/
-void
+int
weechat_ruby_api_config_read_cb (void *data,
struct t_config_file *config_file,
struct t_config_section *section,
@@ -1090,10 +1090,10 @@ weechat_ruby_api_config_read_cb (void *data,
{
struct t_script_callback *script_callback;
char *ruby_argv[5];
- int *rc;
+ int *rc, ret;
script_callback = (struct t_script_callback *)data;
-
+
if (script_callback->function && script_callback->function[0])
{
ruby_argv[0] = script_ptr2str (config_file);
@@ -1107,13 +1107,22 @@ weechat_ruby_api_config_read_cb (void *data,
script_callback->function,
ruby_argv);
- if (rc)
+ if (!rc)
+ ret = WEECHAT_CONFIG_OPTION_SET_ERROR;
+ else
+ {
+ ret = *rc;
free (rc);
+ }
if (ruby_argv[0])
free (ruby_argv[0]);
if (ruby_argv[1])
free (ruby_argv[1]);
+
+ return ret;
}
+
+ return WEECHAT_CONFIG_OPTION_SET_ERROR;
}
/*