From: Vsevolod Stakhov Date: Fri, 24 Jul 2020 14:15:10 +0000 (+0100) Subject: [Minor] Allow rspamd_text to be passed X-Git-Tag: 2.6~217 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3748d403bf05f87ddc12d38869321557b99ad45;p=thirdparty%2Frspamd.git [Minor] Allow rspamd_text to be passed --- diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c index d53ebbc48c..c658181ee1 100644 --- a/src/lua/lua_common.c +++ b/src/lua/lua_common.c @@ -2479,6 +2479,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc, * - u - lua_userdata, argument - (const char * + void *) - classname + pointer * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion) * - f - lua_function, argument - int - position of the function on stack (not lua_registry) + * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry) */ while (*argp) { switch (*argp) { @@ -2511,6 +2512,7 @@ rspamd_lua_universal_pcall (lua_State *L, gint cbref, const gchar* strloc, nargs ++; break; case 'f': + case 't': lua_pushvalue (L, va_arg (ap, gint)); nargs ++; break; diff --git a/src/lua/lua_common.h b/src/lua/lua_common.h index 76680cbc59..cc4c9a9d4d 100644 --- a/src/lua/lua_common.h +++ b/src/lua/lua_common.h @@ -594,6 +594,7 @@ gchar *rspamd_lua_get_module_name (lua_State *L); * - u - lua_userdata, argument - (const char * + void *) - classname + pointer * - b - lua_boolean, argument - gboolean (not bool due to varargs promotion) * - f - lua_function, argument - int - position of the function on stack (not lua_registry) + * - t - lua_text, argument - int - position of the lua_text on stack (not lua_registry) * @param L lua state * @param cbref LUA_REGISTRY reference * @param strloc where this function is called from