diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-30 18:26:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-30 18:26:48 +0100 |
commit | 0e85c23ee12fa524ac9056ee0275fd3c4b15c612 (patch) | |
tree | ba0fcbe01a55297f9264762022bbfa68daa20559 /src/lua/lua_regexp.c | |
parent | f826e627cf53496b3ec79be2cc72a5445c89db19 (diff) | |
download | rspamd-0e85c23ee12fa524ac9056ee0275fd3c4b15c612.tar.gz rspamd-0e85c23ee12fa524ac9056ee0275fd3c4b15c612.zip |
Fix issues with capturing patterns
Diffstat (limited to 'src/lua/lua_regexp.c')
-rw-r--r-- | src/lua/lua_regexp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lua/lua_regexp.c b/src/lua/lua_regexp.c index 60dbc5edc..2f7ea3ea1 100644 --- a/src/lua/lua_regexp.c +++ b/src/lua/lua_regexp.c @@ -348,14 +348,12 @@ lua_regexp_search (lua_State *L) if (capture) { lua_newtable (L); - lua_pushlstring (L, start, end - start); - lua_rawseti (L, -2, 1); for (capn = 0; capn < captures->len; capn ++) { cap = &g_array_index (captures, struct rspamd_re_capture, capn); lua_pushlstring (L, cap->p, cap->len); - lua_rawseti (L, -2, capn + 2); + lua_rawseti (L, -2, capn + 1); } lua_rawseti (L, -2, ++i); |