From: Vsevolod Stakhov Date: Tue, 30 Jun 2015 12:42:50 +0000 (+0100) Subject: Some fixes to pushing captures to lua. X-Git-Tag: 0.9.9~27 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c45e4e323a30888efb321fb290ad0717f8aa4ca9;p=rspamd.git Some fixes to pushing captures to lua. --- 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); }