dbus-1-glib/dbus-glib-ignore-namespaces.patch

69 lines
2.2 KiB
Diff
Raw Normal View History

Index: dbus-glib-0.74/dbus/dbus-gparser.c
===================================================================
--- dbus-glib-0.74.orig/dbus/dbus-gparser.c
+++ dbus-glib-0.74/dbus/dbus-gparser.c
@@ -128,13 +128,17 @@ locate_attributes (const char *element_
if (!found)
{
- g_set_error (error,
- G_MARKUP_ERROR,
- G_MARKUP_ERROR_PARSE,
- _("Attribute \"%s\" is invalid on <%s> element in this context"),
- attribute_names[i], element_name);
- retval = FALSE;
- goto out;
+ /* We want to passthrough namespaced XML nodes that we don't know anything about. */
+ if (strchr (attribute_names[i], ':') == NULL)
+ {
+ g_set_error (error,
+ G_MARKUP_ERROR,
+ G_MARKUP_ERROR_PARSE,
+ _("Attribute \"%s\" is invalid on <%s> element in this context"),
+ attribute_names[i], element_name);
+ retval = FALSE;
+ goto out;
+ }
}
++i;
@@ -177,6 +181,7 @@ struct Parser
PropertyInfo *property;
ArgInfo *arg;
gboolean in_annotation;
+ guint unknown_namespaced_depth;
};
Parser*
@@ -791,10 +796,14 @@ parser_start_element (Parser *parse
}
else
{
- g_set_error (error, G_MARKUP_ERROR,
- G_MARKUP_ERROR_PARSE,
- _("Element <%s> not recognized"),
- element_name);
+ if (strchr (element_name, ':') != NULL)
+ /* Passthrough XML-namespaced nodes */
+ parser->unknown_namespaced_depth += 1;
+ else
+ g_set_error (error, G_MARKUP_ERROR,
+ G_MARKUP_ERROR_PARSE,
+ _("Element <%s> not recognized"),
+ element_name);
}
return TRUE;
@@ -844,6 +853,11 @@ parser_end_element (Parser *parser,
if (parser->node_stack == NULL)
parser->result = top; /* We are done, store the result */
}
+ else if (strchr (element_name, ':') != NULL)
+ {
+ /* Passthrough XML-namespaced nodes */
+ parser->unknown_namespaced_depth -= 1;
+ }
else
g_assert_not_reached (); /* should have had an error on start_element */