From: Vsevolod Stakhov Date: Wed, 11 Dec 2019 17:32:46 +0000 (+0000) Subject: [Minor] Selectors: Try to fix last transformation X-Git-Tag: 2.3~224 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b37aa2a869652b2718b399ad0a4831e263023b3;p=thirdparty%2Frspamd.git [Minor] Selectors: Try to fix last transformation --- diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua index ffc9acd008..b6fc0a001a 100644 --- a/lualib/lua_selectors/transforms.lua +++ b/lualib/lua_selectors/transforms.lua @@ -54,7 +54,13 @@ local transform_function = { ['list'] = true, }, ['process'] = function(inp, t) - return fun.nth(#inp, inp),pure_type(t) + local gen,param,state = fun.iter(inp) + local prev_state + repeat + prev_state = state + state = gen(param, state) + until state == nil + return prev_state,pure_type(t) end, ['description'] = 'Returns the last element', },