diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-04 10:31:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-08-04 10:31:01 +0100 |
commit | b6b2789ddd1800b087790a4e873078e489a06bfd (patch) | |
tree | 3512823294639d9bc394876b8ebc32d3c5fba5b8 /src/libmime/lang_detection.c | |
parent | 335895abf91bd5eb7d0d4d1dc1fecc60d55fd236 (diff) | |
download | rspamd-b6b2789ddd1800b087790a4e873078e489a06bfd.tar.gz rspamd-b6b2789ddd1800b087790a4e873078e489a06bfd.zip |
[Minor] Fix multipattern usage
Diffstat (limited to 'src/libmime/lang_detection.c')
-rw-r--r-- | src/libmime/lang_detection.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c index 9936bedfa..ba638982d 100644 --- a/src/libmime/lang_detection.c +++ b/src/libmime/lang_detection.c @@ -477,17 +477,15 @@ rspamd_language_detector_read_file (struct rspamd_config *cfg, gsize wlen; const char *word = ucl_object_tolstring (w, &wlen); const char *saved; + guint mp_flags = RSPAMD_MULTIPATTERN_ICASE|RSPAMD_MULTIPATTERN_UTF8; + + if (rspamd_multipattern_has_hyperscan ()) { + mp_flags |= RSPAMD_MULTIPATTERN_RE; + } -#ifdef WITH_HYPERSCAN - rspamd_multipattern_add_pattern_len (d->stop_words[cat].mp, - word, wlen, - RSPAMD_MULTIPATTERN_ICASE|RSPAMD_MULTIPATTERN_UTF8 - |RSPAMD_MULTIPATTERN_RE); -#else rspamd_multipattern_add_pattern_len (d->stop_words[cat].mp, word, wlen, - RSPAMD_MULTIPATTERN_ICASE|RSPAMD_MULTIPATTERN_UTF8); -#endif + mp_flags); nelt->stop_words ++; nstop ++; |