]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Selectors: Try to fix last transformation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Dec 2019 17:32:46 +0000 (17:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Dec 2019 17:32:46 +0000 (17:32 +0000)
lualib/lua_selectors/transforms.lua

index ffc9acd00881987f1bf215686ffbb7abad0044e4..b6fc0a001adc5ac8ed5e46742c0b2e14d7e782fc 100644 (file)
@@ -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',
   },