diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-11 17:32:46 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-12-11 17:32:46 +0000 |
commit | 3b37aa2a869652b2718b399ad0a4831e263023b3 (patch) | |
tree | 3b2f593153ea1c41e34bae2c5f2a4b0b14eee442 /lualib | |
parent | f1963ee16c64a66889d437c91f240bc711579007 (diff) | |
download | rspamd-3b37aa2a869652b2718b399ad0a4831e263023b3.tar.gz rspamd-3b37aa2a869652b2718b399ad0a4831e263023b3.zip |
[Minor] Selectors: Try to fix last transformation
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/lua_selectors/transforms.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lualib/lua_selectors/transforms.lua b/lualib/lua_selectors/transforms.lua index ffc9acd00..b6fc0a001 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', }, |