Commit e32afd3f authored by Nick Wellnhofer's avatar Nick Wellnhofer

Fix error message when processing XIncludes with fallbacks

Fixes bug #616491
https://bugzilla.gnome.org/show_bug.cgi?id=616491

Based on merge request !41
parent fa5e8ca6
......@@ -1964,6 +1964,7 @@ static int
xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
xmlXIncludeCtxtPtr newctxt;
int ret = 0;
int oldNbErrors = ctxt->nbErrors;
if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) ||
(ctxt == NULL))
......@@ -1980,7 +1981,7 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */
xmlXIncludeSetFlags(newctxt, ctxt->parseFlags);
ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children);
if (ctxt->nbErrors > 0)
if (ctxt->nbErrors > oldNbErrors)
ret = -1;
else if (ret > 0)
ret = 0; /* xmlXIncludeDoProcess can return +ve number */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment