From c45e4e323a30888efb321fb290ad0717f8aa4ca9 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 30 Jun 2015 13:42:50 +0100 Subject: [PATCH] Some fixes to pushing captures to lua. --- src/lua/lua_regexp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c index 2103d1d9c..c405e33d8 100644 --- a/src/lua/lua_regexp.c +++ b/src/lua/lua_regexp.c @@ -343,12 +343,13 @@ lua_regexp_search (lua_State *L) cap = &g_array_index (captures, struct rspamd_re_capture, capn); lua_pushlstring (L, cap->p, cap->len); - lua_rawseti (L, -2, capn + 1); + lua_rawseti (L, -2, capn + 2); } - lua_rawseti (L, -3, ++i); + lua_rawseti (L, -2, ++i); } else { + lua_pushlstring (L, start, end - start); lua_rawseti (L, -2, ++i); } -- 2.39.5