[Xfce4-commits] [apps/xfce4-terminal] 01/01: JIT compile regexes (taken from gnome-terminal)
noreply at xfce.org
noreply at xfce.org
Tue Jul 17 15:10:02 CEST 2018
This is an automated email from the git hooks/post-receive script.
f 2 4 0 4 p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository apps/xfce4-terminal.
commit 1322a77eb97a5a94b17f0eac97e778aee1973961
Author: Igor <f2404 at yandex.ru>
Date: Tue Jul 17 09:08:54 2018 -0400
JIT compile regexes (taken from gnome-terminal)
This allows to recognize longer and more complex URLs.
---
terminal/terminal-widget.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index 0cefa8a..b58b11b 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -747,6 +747,13 @@ terminal_widget_update_highlight_urls (TerminalWidget *widget)
regex = vte_regex_new_for_match (pattern->pattern, -1,
PCRE2_CASELESS | PCRE2_UTF | PCRE2_NO_UTF_CHECK | PCRE2_MULTILINE,
&error);
+
+ if (error == NULL && (!vte_regex_jit (regex, PCRE2_JIT_COMPLETE, &error) ||
+ !vte_regex_jit (regex, PCRE2_JIT_PARTIAL_SOFT, &error)))
+ {
+ g_critical ("Failed to JIT regular expression '%s': %s\n", pattern->pattern, error->message);
+ g_clear_error (&error);
+ }
#else
regex = g_regex_new (pattern->pattern,
G_REGEX_CASELESS | G_REGEX_OPTIMIZE | G_REGEX_MULTILINE,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list