aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/multipattern.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-04 10:33:51 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-04 10:33:51 +0100
commit8d68b5d3ae90a9e34c83017f2a8248f093e4aa8a (patch)
tree0e739269b6b965e786dbfc1ed3b059c50c2285b7 /src/libutil/multipattern.c
parentb6b2789ddd1800b087790a4e873078e489a06bfd (diff)
downloadrspamd-8d68b5d3ae90a9e34c83017f2a8248f093e4aa8a.tar.gz
rspamd-8d68b5d3ae90a9e34c83017f2a8248f093e4aa8a.zip
[Minor] Fix utf8 multipatterns without hyperscan
Diffstat (limited to 'src/libutil/multipattern.c')
-rw-r--r--src/libutil/multipattern.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libutil/multipattern.c b/src/libutil/multipattern.c
index 8ddd9af38..2842b1d59 100644
--- a/src/libutil/multipattern.c
+++ b/src/libutil/multipattern.c
@@ -535,10 +535,14 @@ rspamd_multipattern_compile (struct rspamd_multipattern *mp, GError **err)
for (guint i = 0; i < mp->cnt; i ++) {
const ac_trie_pat_t *pat;
+ const gchar *pat_flags = NULL;
- pat = &g_array_index (mp->pats, ac_trie_pat_t, i);
+ if (mp->flags & RSPAMD_MULTIPATTERN_UTF8) {
+ pat_flags = "u";
+ }
- re = rspamd_regexp_new (pat->ptr, NULL, err);
+ pat = &g_array_index (mp->pats, ac_trie_pat_t, i);
+ re = rspamd_regexp_new (pat->ptr, pat_flags, err);
if (re == NULL) {
return FALSE;