GError *err = NULL;
enum rspamd_re_type type = RSPAMD_RE_BODY;
gboolean pcre_only = FALSE;
- guint old_flags;
/*
* - `re`* : regular expression object
}
else {
if (pcre_only) {
- old_flags = rspamd_regexp_get_flags (re->re);
- old_flags |= RSPAMD_REGEXP_FLAG_PCRE_ONLY;
- rspamd_regexp_set_flags (re->re, old_flags);
+ rspamd_regexp_set_flags (re->re,
+ rspamd_regexp_get_flags (re->re) | RSPAMD_REGEXP_FLAG_PCRE_ONLY);
}
if (header_str != NULL) {
if (cache_re != re->re) {
rspamd_regexp_unref (re->re);
re->re = rspamd_regexp_ref (cache_re);
+
+ if (pcre_only) {
+ rspamd_regexp_set_flags (re->re,
+ rspamd_regexp_get_flags (re->re) | RSPAMD_REGEXP_FLAG_PCRE_ONLY);
+ }
}
}
}