summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_common.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 16:07:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-04-21 16:07:25 +0100
commit2a7ad799437105f91dfe7e89ba50de655c1d06eb (patch)
tree9edd21cf40959d0c143b906541e41aa9c5d261e6 /src/lua/lua_common.c
parentfc08274623ea616dff051d5555755dc3cfbebee8 (diff)
downloadrspamd-2a7ad799437105f91dfe7e89ba50de655c1d06eb.tar.gz
rspamd-2a7ad799437105f91dfe7e89ba50de655c1d06eb.zip
[Minor] Add lua_geti compat method
Diffstat (limited to 'src/lua/lua_common.c')
-rw-r--r--src/lua/lua_common.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
index 9c4a5d8d1..d53ebbc48 100644
--- a/src/lua/lua_common.c
+++ b/src/lua/lua_common.c
@@ -2539,4 +2539,16 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc,
va_end (ap);
return true;
-} \ No newline at end of file
+}
+
+#if defined( LUA_VERSION_NUM ) && LUA_VERSION_NUM <= 502
+gint
+rspamd_lua_geti (lua_State *L, int pos, int i)
+{
+ pos = lua_absindex (L, pos);
+ lua_pushinteger (L, i);
+ lua_gettable (L, pos);
+
+ return lua_type (L, -1);
+}
+#endif \ No newline at end of file