mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-04-24 18:50:07 +03:00
parser: Remove useless ent->etype test in xmlParseReference
If ent->etype is invalid, ret can't equal XML_ERR_OK.
This commit is contained in:
parent
7ee7f0360a
commit
ec6633afae
72
parser.c
72
parser.c
@ -7271,46 +7271,40 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ret == XML_ERR_OK) && (list != NULL)) {
|
if ((ret == XML_ERR_OK) && (list != NULL)) {
|
||||||
if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
|
ent->children = list;
|
||||||
(ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
|
/*
|
||||||
ent->children = list;
|
* Prune it directly in the generated document
|
||||||
/*
|
* except for single text nodes.
|
||||||
* Prune it directly in the generated document
|
*/
|
||||||
* except for single text nodes.
|
if ((ctxt->replaceEntities == 0) ||
|
||||||
*/
|
(ctxt->parseMode == XML_PARSE_READER) ||
|
||||||
if ((ctxt->replaceEntities == 0) ||
|
((list->type == XML_TEXT_NODE) &&
|
||||||
(ctxt->parseMode == XML_PARSE_READER) ||
|
(list->next == NULL))) {
|
||||||
((list->type == XML_TEXT_NODE) &&
|
ent->owner = 1;
|
||||||
(list->next == NULL))) {
|
while (list != NULL) {
|
||||||
ent->owner = 1;
|
list->parent = (xmlNodePtr) ent;
|
||||||
while (list != NULL) {
|
if (list->doc != ent->doc)
|
||||||
list->parent = (xmlNodePtr) ent;
|
xmlSetTreeDoc(list, ent->doc);
|
||||||
if (list->doc != ent->doc)
|
if (list->next == NULL)
|
||||||
xmlSetTreeDoc(list, ent->doc);
|
ent->last = list;
|
||||||
if (list->next == NULL)
|
list = list->next;
|
||||||
ent->last = list;
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
list = NULL;
|
|
||||||
} else {
|
|
||||||
ent->owner = 0;
|
|
||||||
while (list != NULL) {
|
|
||||||
list->parent = (xmlNodePtr) ctxt->node;
|
|
||||||
list->doc = ctxt->myDoc;
|
|
||||||
if (list->next == NULL)
|
|
||||||
ent->last = list;
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
list = ent->children;
|
|
||||||
#ifdef LIBXML_LEGACY_ENABLED
|
|
||||||
if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
|
|
||||||
xmlAddEntityReference(ent, list, NULL);
|
|
||||||
#endif /* LIBXML_LEGACY_ENABLED */
|
|
||||||
}
|
}
|
||||||
} else {
|
list = NULL;
|
||||||
xmlFreeNodeList(list);
|
} else {
|
||||||
list = NULL;
|
ent->owner = 0;
|
||||||
}
|
while (list != NULL) {
|
||||||
|
list->parent = (xmlNodePtr) ctxt->node;
|
||||||
|
list->doc = ctxt->myDoc;
|
||||||
|
if (list->next == NULL)
|
||||||
|
ent->last = list;
|
||||||
|
list = list->next;
|
||||||
|
}
|
||||||
|
list = ent->children;
|
||||||
|
#ifdef LIBXML_LEGACY_ENABLED
|
||||||
|
if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
|
||||||
|
xmlAddEntityReference(ent, list, NULL);
|
||||||
|
#endif /* LIBXML_LEGACY_ENABLED */
|
||||||
|
}
|
||||||
} else if ((ret != XML_ERR_OK) &&
|
} else if ((ret != XML_ERR_OK) &&
|
||||||
(ret != XML_WAR_UNDECLARED_ENTITY)) {
|
(ret != XML_WAR_UNDECLARED_ENTITY)) {
|
||||||
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
|
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user