summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2015-10-04 22:45:02 +0200
committerChristian Persch <chpe@gnome.org>2015-10-04 22:45:02 +0200
commit4fb5732547c8b618e57d59b505300d076f54c6a9 (patch)
tree0504375b3ed63302fd0375cb4932ea088833be34
parent8dfe0db6022688a581795e2571c48100db105836 (diff)
downloadvte-4fb5732547c8b618e57d59b505300d076f54c6a9.tar.gz
regex: Move some shared code to vte_terminal_match_check_internal
Initialising the out params can be done in the main function.
-rw-r--r--src/vte.cc28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/vte.cc b/src/vte.cc
index 34301ecb..5f8fa424 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -1631,15 +1631,6 @@ vte_terminal_match_check_internal_pcre(VteTerminal *terminal,
"Checking for pcre match at (%ld,%ld).\n", row, column);
/* Identical with vte_terminal_match_check_internal_gregex until END */
- if (tag != NULL) {
- *tag = -1;
- }
- if (start != NULL) {
- *start = 0;
- }
- if (end != NULL) {
- *end = 0;
- }
if (!match_rowcol_to_offset(terminal, column,row,
&offset, &sattr, &eattr))
@@ -1814,15 +1805,6 @@ vte_terminal_match_check_internal_gregex(VteTerminal *terminal,
"Checking for gregex match at (%ld,%ld).\n", row, column);
/* Identical with vte_terminal_match_check_internal_pcre until END */
- if (tag != NULL) {
- *tag = -1;
- }
- if (start != NULL) {
- *start = 0;
- }
- if (end != NULL) {
- *end = 0;
- }
if (!match_rowcol_to_offset(terminal, column,row,
&offset, &sattr, &eattr))
@@ -1957,6 +1939,16 @@ vte_terminal_match_check_internal(VteTerminal *terminal,
vte_terminal_match_contents_refresh(terminal);
}
+ if (tag != NULL) {
+ *tag = -1;
+ }
+ if (start != NULL) {
+ *start = 0;
+ }
+ if (end != NULL) {
+ *end = 0;
+ }
+
#ifdef WITH_PCRE2
if (G_LIKELY(pvt->match_regex_mode == VTE_REGEX_PCRE2))
return vte_terminal_match_check_internal_pcre(terminal, column, row, tag, start, end);