diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-23 14:49:59 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-04-23 14:49:59 +0100 |
commit | 9ab1bcfc44646ee5403247a2f2a705e47a243778 (patch) | |
tree | b7c9468a6520929604e2b63e6da41f6109d1465d /src/lua/lua_trie.c | |
parent | db2aed4685476f5d34c783dd4d21d46ef3312026 (diff) | |
download | rspamd-9ab1bcfc44646ee5403247a2f2a705e47a243778.tar.gz rspamd-9ab1bcfc44646ee5403247a2f2a705e47a243778.zip |
[Feature] Allow binary patterns in lua_trie
Diffstat (limited to 'src/lua/lua_trie.c')
-rw-r--r-- | src/lua/lua_trie.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lua/lua_trie.c b/src/lua/lua_trie.c index 5803a1d0b..befb956e4 100644 --- a/src/lua/lua_trie.c +++ b/src/lua/lua_trie.c @@ -112,8 +112,11 @@ lua_trie_create (lua_State *L) while (lua_next (L, -2) != 0) { if (lua_isstring (L, -1)) { - rspamd_multipattern_add_pattern (trie, lua_tostring (L, -1), - flags); + const gchar *pat; + gsize patlen; + + pat = lua_tolstring (L, -1, &patlen); + rspamd_multipattern_add_pattern_len (trie, pat, patlen, flags); } lua_pop (L, 1); |