summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2016-06-23 13:25:23 +0200
committerAilin Nemui <ailin@z30a.localdomain>2017-01-02 17:50:14 +0100
commit5dcf291f2144564363f734dba15760d3a82b61c2 (patch)
tree05c0df68c8cea8474336a006d1db1aea978fe7f1 /src/fe-text/textbuffer.c
parent5eaead761f1812fb9d4058b2bc38468521794693 (diff)
downloadirssi-5dcf291f2144564363f734dba15760d3a82b61c2.zip
Use the RAW flag when building the regexps.
Also, plugged a memory leak when retrieving the match position.
Diffstat (limited to 'src/fe-text/textbuffer.c')
-rw-r--r--src/fe-text/textbuffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c
index f35848a2..979a6104 100644
--- a/src/fe-text/textbuffer.c
+++ b/src/fe-text/textbuffer.c
@@ -546,7 +546,7 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
preg = NULL;
if (regexp) {
- preg = g_regex_new(text, (case_sensitive ? 0 : G_REGEX_CASELESS), 0, NULL);
+ preg = g_regex_new(text, G_REGEX_RAW | (case_sensitive ? 0 : G_REGEX_CASELESS), 0, NULL);
if (preg == NULL)
return NULL;
@@ -602,7 +602,7 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
}
}
- if (regexp)
+ if (preg != NULL)
g_regex_unref(preg);
g_string_free(str, TRUE);
return matches;