[glib] GMarkup: clear attributes on ignorned tags



commit daff84e23c4870f674293a90f36d79f4587d20cc
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Oct 29 09:01:32 2013 -0700

    GMarkup: clear attributes on ignorned tags
    
    Make sure that if we ignore a tag then we also clear the attributes that
    we already collected so that they don't end up on the next unignored tag
    opening.
    
    Also add some extra brackets for clarity (it doesn't make any difference
    -- I just think it reads nicer this way).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=665634

 glib/gmarkup.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/glib/gmarkup.c b/glib/gmarkup.c
index f27bb3b..89404e5 100644
--- a/glib/gmarkup.c
+++ b/glib/gmarkup.c
@@ -1016,10 +1016,11 @@ emit_start_element (GMarkupParseContext  *context,
    *
    * We deal with the end of the subparser from emit_end_element.
    */
-  if (context->flags & G_MARKUP_IGNORE_QUALIFIED && strchr (current_element (context), ':'))
+  if ((context->flags & G_MARKUP_IGNORE_QUALIFIED) && strchr (current_element (context), ':'))
     {
       static const GMarkupParser ignore_parser;
       g_markup_parse_context_push (context, &ignore_parser, NULL);
+      clear_attributes (context);
       return;
     }
 
@@ -1070,7 +1071,7 @@ emit_end_element (GMarkupParseContext  *context,
   possibly_finish_subparser (context);
 
   /* We might have just returned from our ignore subparser */
-  if (context->flags & G_MARKUP_IGNORE_QUALIFIED && strchr (current_element (context), ':'))
+  if ((context->flags & G_MARKUP_IGNORE_QUALIFIED) && strchr (current_element (context), ':'))
     {
       g_markup_parse_context_pop (context);
       pop_tag (context);


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