rspamd_regexp_new (const gchar *pattern, const gchar *flags,
GError **err)
{
- const gchar *start = pattern, *end, *flags_str, *err_str;
+ const gchar *start = pattern, *end, *flags_str = NULL, *err_str;
rspamd_regexp_t *res;
pcre *r;
gchar sep = 0, *real_pattern;
sep, pattern);
return NULL;
}
- flags = end + 1;
+ flags_str = end + 1;
start ++;
}
}
strict_flags = TRUE;
start = pattern;
end = pattern + strlen (pattern);
+ flags_str = flags;
}
regexp_flags |= PCRE_UTF8 ;
- if (flags != NULL) {
- flags_str = flags;
+ if (flags_str != NULL) {
while (*flags_str) {
switch (*flags_str) {
case 'i':
*start = mt + ovec[0];
}
if (end) {
- *end = mt + ovec[0] + ovec[1];
+ *end = mt + ovec[1];
}
if (re->flags & RSPAMD_REGEXP_FLAG_FULL_MATCH) {