[vte] regex: Fix pcre2_jit_compile return value check



commit 331eea79ec7011242e3cb07162cee4e67fdf95c4
Author: Christian Persch <chpe gnome org>
Date:   Sat Dec 26 12:27:22 2015 +0100

    regex: Fix pcre2_jit_compile return value check
    
    This returns 0 for success, and negative for failure.

 src/vteregex.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/vteregex.cc b/src/vteregex.cc
index 7ecc575..4b56b37 100644
--- a/src/vteregex.cc
+++ b/src/vteregex.cc
@@ -278,8 +278,10 @@ vte_regex_jit(VteRegex *regex,
         g_return_val_if_fail(regex != NULL, FALSE);
 
         r = pcre2_jit_compile_8(regex->code, flags);
+        if (r < 0)
+                return set_gerror_from_pcre_error(r, error);
 
-        return set_gerror_from_pcre_error(r, error);
+        return TRUE;
 #else
         return set_unsupported_error(error);
 #endif /* WITH_PCRE2 */


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