summaryrefslogtreecommitdiff
path: root/xinclude.c
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-01-02 14:59:41 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-01-02 14:59:41 +0000
commitaae10527fa2f3356a425f1fa42ffed4a9073e6b6 (patch)
treed8d654f667505cd65370e793de0d24193483413e /xinclude.c
parent1a9b7084f6313be41edbe143c1f56f327504d06c (diff)
downloadlibxml2-aae10527fa2f3356a425f1fa42ffed4a9073e6b6.tar.gz
fixed problem with "recursive" include (fallback contains another include
* xinclude.c: fixed problem with "recursive" include (fallback contains another include - Bug 129969)
Diffstat (limited to 'xinclude.c')
-rw-r--r--xinclude.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/xinclude.c b/xinclude.c
index 0b34c3e3..2697cfa2 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -1760,11 +1760,26 @@ loaded:
*/
static int
xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
+ xmlXIncludeCtxtPtr newctxt;
+ int ret = 0;
+
if ((fallback == NULL) || (ctxt == NULL))
return(-1);
+ /*
+ * It's possible that the fallback also has 'includes'
+ * (Bug 129969), so we re-process the fallback just in case
+ */
+ newctxt = xmlXIncludeNewContext(ctxt->doc);
+ if (newctxt == NULL)
+ return (-1);
+ xmlXIncludeSetFlags(newctxt, ctxt->parseFlags);
+ ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children);
+ if ((ret >=0) && (ctxt->nbErrors > 0))
+ ret = -1;
+ xmlXIncludeFreeContext(newctxt);
ctxt->incTab[nr]->inc = xmlCopyNodeList(fallback->children);
- return(0);
+ return(ret);
}
/************************************************************************