aboutsummaryrefslogtreecommitdiffstats
path: root/src/lua/lua_trie.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:17:24 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-04-14 15:17:24 +0100
commit4d1669e4b40e8a8e93ab652a60ed35ea64cf14da (patch)
tree7a703f756f47b774acc5e5f10781324dfbbca837 /src/lua/lua_trie.c
parenta5a312b65b3aa2539eeb483a04126f5f6a2b0014 (diff)
downloadrspamd-4d1669e4b40e8a8e93ab652a60ed35ea64cf14da.tar.gz
rspamd-4d1669e4b40e8a8e93ab652a60ed35ea64cf14da.zip
[Feature] Allow to have different flags for different patterns
Diffstat (limited to 'src/lua/lua_trie.c')
-rw-r--r--src/lua/lua_trie.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lua/lua_trie.c b/src/lua/lua_trie.c
index c02beaf27..5803a1d0b 100644
--- a/src/lua/lua_trie.c
+++ b/src/lua/lua_trie.c
@@ -88,7 +88,7 @@ static gint
lua_trie_create (lua_State *L)
{
struct rspamd_multipattern *trie, **ptrie;
- gint npat = 0;
+ gint npat = 0, flags = RSPAMD_MULTIPATTERN_ICASE|RSPAMD_MULTIPATTERN_GLOB;
GError *err = NULL;
if (!lua_istable (L, 1)) {
@@ -107,13 +107,13 @@ lua_trie_create (lua_State *L)
lua_pop (L, 1);
}
- trie = rspamd_multipattern_create_sized (npat,
- RSPAMD_MULTIPATTERN_ICASE|RSPAMD_MULTIPATTERN_GLOB);
+ trie = rspamd_multipattern_create_sized (npat, flags);
lua_pushnil (L);
while (lua_next (L, -2) != 0) {
if (lua_isstring (L, -1)) {
- rspamd_multipattern_add_pattern (trie, lua_tostring (L, -1));
+ rspamd_multipattern_add_pattern (trie, lua_tostring (L, -1),
+ flags);
}
lua_pop (L, 1);