mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-10 08:58:16 +03:00
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
This commit is contained in:
parent
fa5e8ca66f
commit
e32afd3fd7
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user