From 9ab1bcfc44646ee5403247a2f2a705e47a243778 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 23 Apr 2016 14:49:59 +0100 Subject: [PATCH] [Feature] Allow binary patterns in lua_trie --- src/lua/lua_trie.c | 7 +++++-- 1 file 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); -- 2.39.5