Use the RAW flag when building the regexps.

Also, plugged a memory leak when retrieving the match position.
This commit is contained in:
LemonBoy 2016-06-23 13:25:23 +02:00 committed by Ailin Nemui
commit 5dcf291f21
3 changed files with 16 additions and 13 deletions

View file

@ -328,7 +328,7 @@ static void ignore_init_rec(IGNORE_REC *rec)
if (rec->regexp && rec->pattern != NULL) {
GError *re_error;
rec->preg = g_regex_new(rec->pattern, G_REGEX_CASELESS, 0, &re_error);
rec->preg = g_regex_new(rec->pattern, G_REGEX_OPTIMIZE | G_REGEX_RAW | G_REGEX_CASELESS, 0, &re_error);
if (rec->preg == NULL) {
g_warning("Failed to compile regexp '%s': %s", rec->pattern, re_error->message);