diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 56a0b4ff1..3cca31489 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -44,6 +44,7 @@ Bug fixes:: * guile: return integer (0/1) instead of boolean in API functions * guile: fix return value of static strings in API functions * irc: fix CTCP PING reply when the option irc.ctcp.ping is set to non-empty value + * lua: fix boolean return value (as integer) in API functions * relay: fix parsing of CAP command without arguments in irc protocol, send ACK only if all capabilities received are OK and NAK otherwise (issue #1040) Tests:: diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index 09b085cf9..42105fdca 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -67,8 +67,12 @@ plugin_script_str2ptr (weechat_lua_plugin, \ LUA_CURRENT_SCRIPT_NAME, \ lua_function_name, __string) -#define API_RETURN_OK return 1 -#define API_RETURN_ERROR return 0 +#define API_RETURN_OK \ + lua_pushinteger (L, 1); \ + return 1 +#define API_RETURN_ERROR \ + lua_pushinteger (L, 0); \ + return 1 #define API_RETURN_EMPTY \ lua_pushstring (L, ""); \ return 0