1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

lua: fix boolean return value (as integer) in API functions

This commit is contained in:
Sébastien Helleu
2017-10-03 21:17:22 +02:00
parent 255e46eaef
commit 7949146687
2 changed files with 7 additions and 2 deletions
+1
View File
@@ -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::
+6 -2
View File
@@ -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