aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/lang_detection.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-04 10:31:01 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-08-04 10:31:01 +0100
commitb6b2789ddd1800b087790a4e873078e489a06bfd (patch)
tree3512823294639d9bc394876b8ebc32d3c5fba5b8 /src/libmime/lang_detection.c
parent335895abf91bd5eb7d0d4d1dc1fecc60d55fd236 (diff)
downloadrspamd-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.c14
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 ++;