summaryrefslogtreecommitdiff
path: root/src/plugins/lua/weechat-lua-api.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-10-03 21:17:22 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-10-03 21:17:22 +0200
commit7949146687ee8e88bfcfcfb27b7466692b10cedf (patch)
tree179e48cfc465b6e73910f3c51ec5332fa939484a /src/plugins/lua/weechat-lua-api.c
parent255e46eaef31d87e7df3a49e3b58745ff8dd251a (diff)
downloadweechat-7949146687ee8e88bfcfcfb27b7466692b10cedf.zip
lua: fix boolean return value (as integer) in API functions
Diffstat (limited to 'src/plugins/lua/weechat-lua-api.c')
-rw-r--r--src/plugins/lua/weechat-lua-api.c8
1 files changed, 6 insertions, 2 deletions
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