From 8dbd495eca8412d54dfea607e91c7159c484effc Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Fri, 27 Dec 2002 11:34:48 +0000 Subject: [PATCH] fixing bug #95296, when the predefined entities are redefined in the DTD * SAX.c: fixing bug #95296, when the predefined entities are redefined in the DTD the default one must be used instead anyway. Daniel --- ChangeLog | 6 ++++++ SAX.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e68d634a..2a8da044 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Dec 27 12:18:14 CET 2002 Daniel Veillard + + * SAX.c: fixing bug #95296, when the predefined entities + are redefined in the DTD the default one must be used + instead anyway. + Wed Dec 25 19:22:06 MST 2002 John Fleck * doc/xmllint.xml diff --git a/SAX.c b/SAX.c index 785ea0ba..74218f34 100644 --- a/SAX.c +++ b/SAX.c @@ -338,13 +338,18 @@ xmlEntityPtr getEntity(void *ctx, const xmlChar *name) { xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; - xmlEntityPtr ret; + xmlEntityPtr ret = NULL; #ifdef DEBUG_SAX xmlGenericError(xmlGenericErrorContext, "SAX.getEntity(%s)\n", name); #endif + if (ctxt->inSubset == 0) { + ret = xmlGetPredefinedEntity(name); + if (ret != NULL) + return(ret); + } if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) { if (ctxt->inSubset == 2) { ctxt->myDoc->standalone = 0;