[vte] widget: Also set n_matches out param when returning nullptr



commit 0bc2d7a2c29e5af9751f957c4e49808d47b98c58
Author: Christian Persch <chpe src gnome org>
Date:   Wed Apr 29 15:01:07 2020 +0200

    widget: Also set n_matches out param when returning nullptr

 src/vtegtk.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/vtegtk.cc b/src/vtegtk.cc
index cda59271..eb7147ab 100644
--- a/src/vtegtk.cc
+++ b/src/vtegtk.cc
@@ -2292,11 +2292,11 @@ vte_terminal_event_check_regex_array(VteTerminal *terminal,
                                      guint32 match_flags,
                                      gsize *n_matches)
 {
-        if (n_regexes == 0) {
-                if (n_matches)
-                        *n_matches = 0;
+        if (n_matches)
+                *n_matches = 0;
+
+        if (n_regexes == 0)
                 return nullptr;
-        }
 
         auto matches = vte::glib::take_free_ptr(g_new0(char*, n_regexes));
         if (!vte_terminal_event_check_regex_simple(terminal,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]