]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not mix HS_FLAG_SINGLEMATCH and HS_FLAG_SOM_LEFTMOST
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Nov 2020 11:20:58 +0000 (11:20 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 17 Nov 2020 11:20:58 +0000 (11:20 +0000)
src/libserver/re_cache.c

index c35da879d56417faed192026ef20e168690e8b22..e4b00e541c6534cd8d7586d2213cd1318fbfdb2f 100644 (file)
@@ -1977,13 +1977,14 @@ rspamd_re_cache_compile_timer_cb (EV_P_ ev_timer *w, int revents )
                if (pcre_flags & PCRE_FLAG(DOTALL)) {
                        hs_flags[i] |= HS_FLAG_DOTALL;
                }
-               if (rspamd_regexp_get_maxhits (re) == 1) {
-                       hs_flags[i] |= HS_FLAG_SINGLEMATCH;
-               }
+
 
                if (re_flags & RSPAMD_REGEXP_FLAG_LEFTMOST) {
                        hs_flags[i] |= HS_FLAG_SOM_LEFTMOST;
                }
+               else if (rspamd_regexp_get_maxhits (re) == 1) {
+                       hs_flags[i] |= HS_FLAG_SINGLEMATCH;
+               }
 
                gchar *pat = rspamd_re_cache_hs_pattern_from_pcre (re);