mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-08-08 17:42:14 +03:00
small fix fixing bug #58539 reported by coolo, in entity substitution mode
* SAX.c: small fix fixing bug #58539 reported by coolo, in entity substitution mode text at the end of the entity might be added due to text coalescing. * nanoftp.c parser.c: small cleanup Daniel
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
Mon Aug 13 12:33:40 CEST 2001 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* SAX.c: small fix fixing bug #58539 reported by coolo, in
|
||||||
|
entity substitution mode text at the end of the entity might
|
||||||
|
be added due to text coalescing.
|
||||||
|
* nanoftp.c parser.c: small cleanup
|
||||||
|
|
||||||
Wed Aug 8 22:57:05 CEST 2001 Daniel Veillard <daniel@veillard.com>
|
Wed Aug 8 22:57:05 CEST 2001 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* HACKING: added John Fleck right to commit in the doc subdir
|
* HACKING: added John Fleck right to commit in the doc subdir
|
||||||
|
8
SAX.c
8
SAX.c
@@ -1307,8 +1307,10 @@ characters(void *ctx, const xmlChar *ch, int len)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
int isText = xmlNodeIsText(lastChild);
|
int coalesceText = (lastChild != NULL) &&
|
||||||
if ((isText) && (ctxt->nodemem != 0)) {
|
(lastChild->type == XML_TEXT_NODE) &&
|
||||||
|
(lastChild->name == xmlStringText);
|
||||||
|
if ((coalesceText) && (ctxt->nodemem != 0)) {
|
||||||
#ifndef XML_USE_BUFFER_CONTENT
|
#ifndef XML_USE_BUFFER_CONTENT
|
||||||
/*
|
/*
|
||||||
* The whole point of maintaining nodelen and nodemem,
|
* The whole point of maintaining nodelen and nodemem,
|
||||||
@@ -1339,7 +1341,7 @@ characters(void *ctx, const xmlChar *ch, int len)
|
|||||||
#else
|
#else
|
||||||
xmlTextConcat(lastChild, ch, len);
|
xmlTextConcat(lastChild, ch, len);
|
||||||
#endif
|
#endif
|
||||||
} else if (isText) {
|
} else if (coalesceText) {
|
||||||
xmlTextConcat(lastChild, ch, len);
|
xmlTextConcat(lastChild, ch, len);
|
||||||
if (ctxt->node->children != NULL) {
|
if (ctxt->node->children != NULL) {
|
||||||
ctxt->nodelen = xmlStrlen(lastChild->content);
|
ctxt->nodelen = xmlStrlen(lastChild->content);
|
||||||
|
@@ -1220,6 +1220,7 @@ xmlNanoFTPGetConnection(void *ctx) {
|
|||||||
struct sockaddr_in dataAddr;
|
struct sockaddr_in dataAddr;
|
||||||
SOCKLEN_T dataAddrLen;
|
SOCKLEN_T dataAddrLen;
|
||||||
|
|
||||||
|
retry:
|
||||||
ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||||
if (ctxt->dataFd < 0) {
|
if (ctxt->dataFd < 0) {
|
||||||
xmlGenericError(xmlGenericErrorContext,
|
xmlGenericError(xmlGenericErrorContext,
|
||||||
|
7
parser.c
7
parser.c
@@ -28,9 +28,6 @@
|
|||||||
* See Copyright for the status of this software.
|
* See Copyright for the status of this software.
|
||||||
*
|
*
|
||||||
* daniel@veillard.com
|
* daniel@veillard.com
|
||||||
*
|
|
||||||
* 14 Nov 2000 ht - truncated definitions of xmlSubstituteEntitiesDefaultValue
|
|
||||||
* and xmlDoValidityCheckingDefaultValue for VMS
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libxml.h"
|
#include "libxml.h"
|
||||||
@@ -5470,7 +5467,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
|
|||||||
ctxt->errNo = XML_ERR_NAME_REQUIRED;
|
ctxt->errNo = XML_ERR_NAME_REQUIRED;
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt->userData,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"xmlParseEntityRef: no name\n");
|
"xmlParseStringEntityRef: no name\n");
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
ctxt->disableSAX = 1;
|
ctxt->disableSAX = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -5602,7 +5599,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
|
|||||||
ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING;
|
ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING;
|
||||||
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
|
||||||
ctxt->sax->error(ctxt->userData,
|
ctxt->sax->error(ctxt->userData,
|
||||||
"xmlParseEntityRef: expecting ';'\n");
|
"xmlParseStringEntityRef: expecting ';'\n");
|
||||||
ctxt->wellFormed = 0;
|
ctxt->wellFormed = 0;
|
||||||
ctxt->disableSAX = 1;
|
ctxt->disableSAX = 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user