1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-04 12:58:17 +03:00

fixed problem with "recursive" include (fallback contains another include

* xinclude.c: fixed problem with "recursive" include (fallback
  contains another include - Bug 129969)
This commit is contained in:
William M. Brack 2004-01-02 14:59:41 +00:00
parent 1a9b7084f6
commit aae10527fa
2 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
Fri Jan 2 22:58:29 HKT 2004 William Brack <wbrack@mmm.com.hk>
* xinclude.c: fixed problem with "recursive" include (fallback
contains another include - Bug 129969)
Fri Jan 2 11:40:06 CET 2004 Daniel Veillard <daniel@veillard.com>
* SAX2.c: found and fixed a bug misallocating some non

View File

@ -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);
}
/************************************************************************