[template-glib] template: short-circuit expand visitor if error ocurred



commit 511e63f5d1a9726422c6325a177e1152669d4fcb
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 11 23:42:51 2016 -0800

    template: short-circuit expand visitor if error ocurred

 src/tmpl-template.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/tmpl-template.c b/src/tmpl-template.c
index f30efdd..693d2a6 100644
--- a/src/tmpl-template.c
+++ b/src/tmpl-template.c
@@ -268,6 +268,10 @@ tmpl_template_expand_visitor (TmplNode *node,
   g_assert (TMPL_IS_NODE (node));
   g_assert (state != NULL);
 
+/* Short cirtcuit if an error occurred */
+  if (state->result == FALSE)
+    return;
+
   if (TMPL_IS_TEXT_NODE (node))
     {
       g_string_append (state->output, tmpl_text_node_get_text (TMPL_TEXT_NODE (node)));


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