[libxml2] Fix error message when processing XIncludes with fallbacks
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Fix error message when processing XIncludes with fallbacks
- Date: Fri, 13 Sep 2019 15:51:00 +0000 (UTC)
commit e32afd3fd7785d861066dd06f93266cb6f433969
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Fri Sep 13 15:45:21 2019 +0200
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
xinclude.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/xinclude.c b/xinclude.c
index 53aa3e95..b8e84ec3 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -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 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]