1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-26 14:50:08 +03:00

parser: Don't use 'standalone' member of xmlParserInput

The standalone declaration is only parsed in the main input stream.
This commit is contained in:
Nick Wellnhofer 2023-08-08 15:19:39 +02:00
parent d9ec182b65
commit 131d0dc0a7
2 changed files with 3 additions and 5 deletions

View File

@ -10320,7 +10320,8 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
* XML declaration but it does not have a standalone attribute.
* It will be overwritten later if a standalone attribute is found.
*/
ctxt->input->standalone = -2;
ctxt->standalone = -2;
/*
* We know that '<?xml' is here.
@ -10401,7 +10402,7 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
GROW;
SKIP_BLANKS;
ctxt->input->standalone = xmlParseSDDecl(ctxt);
ctxt->standalone = xmlParseSDDecl(ctxt);
SKIP_BLANKS;
if ((RAW == '?') && (NXT(1) == '>')) {
@ -10525,7 +10526,6 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
*/
return(-1);
}
ctxt->standalone = ctxt->input->standalone;
SKIP_BLANKS;
} else {
ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
@ -11265,7 +11265,6 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
xmlHaltParser(ctxt);
return(0);
}
ctxt->standalone = ctxt->input->standalone;
if ((ctxt->encoding == NULL) &&
(ctxt->input->encoding != NULL))
ctxt->encoding = xmlStrdup(ctxt->input->encoding);

View File

@ -1601,7 +1601,6 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) {
memset(input, 0, sizeof(xmlParserInput));
input->line = 1;
input->col = 1;
input->standalone = -1;
/*
* If the context is NULL the id cannot be initialized, but that