patch 9.1.0848: if_lua: v:false/v:true are not evaluated to boolean
Problem: if_lua: v:false/v:true are not evaluated to boolean
Solution: Use lua_pushboolean() instead of lua_pushinteger().
(zeertzjq)
fixes: #15994
closes: #11419
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/if_lua.c b/src/if_lua.c
index 4d19c3e..d01b9f9 100644
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -595,7 +595,7 @@
case VAR_BOOL:
case VAR_SPECIAL:
if (tv->vval.v_number <= VVAL_TRUE)
- lua_pushinteger(L, (int) tv->vval.v_number);
+ lua_pushboolean(L, (int) tv->vval.v_number);
else
lua_pushnil(L);
break;