Browse Source

[Feature] Allow binary patterns in lua_trie

tags/1.3.0
Vsevolod Stakhov 8 years ago
parent
commit
9ab1bcfc44
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      src/lua/lua_trie.c

+ 5
- 2
src/lua/lua_trie.c View File

@@ -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);

Loading…
Cancel
Save