1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Fixing two stupid bugs on entities and HTML tree deallocation, Daniel.

This commit is contained in:
Daniel Veillard
1999-09-01 12:19:13 +00:00
parent e7a5a77dd0
commit 1ff7ae3dfd
3 changed files with 56 additions and 4 deletions

View File

@ -260,6 +260,15 @@ xmlGetParameterEntity(xmlDocPtr doc, const CHAR *name) {
(!xmlStrcmp(cur->name, name))) return(cur);
}
}
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
for (i = 0;i < table->nb_entities;i++) {
cur = &table->table[i];
if (((cur->type == XML_INTERNAL_PARAMETER_ENTITY) ||
(cur->type == XML_EXTERNAL_PARAMETER_ENTITY)) &&
(!xmlStrcmp(cur->name, name))) return(cur);
}
}
return(NULL);
}
@ -317,6 +326,15 @@ xmlGetDocEntity(xmlDocPtr doc, const CHAR *name) {
(!xmlStrcmp(cur->name, name))) return(cur);
}
}
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
for (i = 0;i < table->nb_entities;i++) {
cur = &table->table[i];
if ((cur->type != XML_INTERNAL_PARAMETER_ENTITY) &&
(cur->type != XML_EXTERNAL_PARAMETER_ENTITY) &&
(!xmlStrcmp(cur->name, name))) return(cur);
}
}
if (xmlPredefinedEntities == NULL)
xmlInitializePredefinedEntities();
table = xmlPredefinedEntities;