mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 11:50:10 +02:00
Use the RAW flag when building the regexps.
Also, plugged a memory leak when retrieving the match position.
This commit is contained in:
parent
5eaead761f
commit
5dcf291f21
3 changed files with 16 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue