diff options
Diffstat (limited to 'xinclude.c')
-rw-r--r-- | xinclude.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1816,8 +1816,10 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) { return (-1); xmlXIncludeSetFlags(newctxt, ctxt->parseFlags); ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children); - if ((ret >=0) && (ctxt->nbErrors > 0)) + if (ctxt->nbErrors > 0) ret = -1; + else if (ret > 0) + ret = 0; /* xmlXIncludeDoProcess can return +ve number */ xmlXIncludeFreeContext(newctxt); ctxt->incTab[nr]->inc = xmlCopyNodeList(fallback->children); @@ -2206,6 +2208,8 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) { if (xmlXIncludeTestNode(ctxt, cur)) xmlXIncludePreProcessNode(ctxt, cur); } else { + if (cur == tree) + break; do { cur = cur->parent; if (cur == NULL) break; /* do */ |