diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-11-22 08:14:29 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-11-22 08:14:29 +0100 |
commit | 1ef3237b6b2f7ed07faccc0c1ab897f37827421d (patch) | |
tree | b236f04b6efcd49667a389362030fb4dd4b0cb24 /src/plugins/perl | |
parent | e253a2509ae648a358991103fafbd18d21bb06cd (diff) | |
download | weechat-1ef3237b6b2f7ed07faccc0c1ab897f37827421d.zip |
api: return value in function command(), remove WeeChat error after command callback if return code is WEECHAT_RC_ERROR
Diffstat (limited to 'src/plugins/perl')
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 11 | ||||
-rw-r--r-- | src/plugins/perl/weechat-perl.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index b6af4654d..02a8c3784 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -4019,6 +4019,7 @@ XS (XS_weechat_api_bar_remove) XS (XS_weechat_api_command) { char *buffer, *command; + int rc; dXSARGS; API_FUNC(1, "command", API_RETURN_ERROR); @@ -4028,12 +4029,12 @@ XS (XS_weechat_api_command) buffer = SvPV_nolen (ST (0)); command = SvPV_nolen (ST (1)); - plugin_script_api_command (weechat_perl_plugin, - perl_current_script, - API_STR2PTR(buffer), - command); + rc = plugin_script_api_command (weechat_perl_plugin, + perl_current_script, + API_STR2PTR(buffer), + command); - API_RETURN_OK; + API_RETURN_INT(rc); } XS (XS_weechat_api_info_get) diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c index 6ab7c59f3..4422bdef1 100644 --- a/src/plugins/perl/weechat-perl.c +++ b/src/plugins/perl/weechat-perl.c @@ -674,7 +674,7 @@ weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer, weechat_perl_unload_all (); } else - return WEECHAT_RC_ERROR; + WEECHAT_COMMAND_ERROR; } else { @@ -724,7 +724,7 @@ weechat_perl_command_cb (void *data, struct t_gui_buffer *buffer, perl_quiet = 0; } else - return WEECHAT_RC_ERROR; + WEECHAT_COMMAND_ERROR; } return WEECHAT_RC_OK; |