diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-30 13:42:50 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-30 13:42:50 +0100 |
commit | c17f742da32e8bc216991a70a5eded31d6cefd87 (patch) | |
tree | 5a04b9825519e9ff53d03f89a127ace503d62487 /src | |
parent | 1ba46d50f44e7ad5ac17c9c1b9493e6638c4200d (diff) | |
download | rspamd-c17f742da32e8bc216991a70a5eded31d6cefd87.tar.gz rspamd-c17f742da32e8bc216991a70a5eded31d6cefd87.zip |
Some fixes to pushing captures to lua.
Diffstat (limited to 'src')
-rw-r--r-- | src/lua/lua_regexp.c | 5 |
1 files 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); } |