diff --git a/ChangeLog b/ChangeLog index 28cc2d7d..0c355728 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Mon Aug 13 12:33:40 CEST 2001 Daniel Veillard + + * 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 * HACKING: added John Fleck right to commit in the doc subdir diff --git a/SAX.c b/SAX.c index 86e95d7e..b5421579 100644 --- a/SAX.c +++ b/SAX.c @@ -1307,8 +1307,10 @@ characters(void *ctx, const xmlChar *ch, int len) } #endif } else { - int isText = xmlNodeIsText(lastChild); - if ((isText) && (ctxt->nodemem != 0)) { + int coalesceText = (lastChild != NULL) && + (lastChild->type == XML_TEXT_NODE) && + (lastChild->name == xmlStringText); + if ((coalesceText) && (ctxt->nodemem != 0)) { #ifndef XML_USE_BUFFER_CONTENT /* * The whole point of maintaining nodelen and nodemem, @@ -1339,7 +1341,7 @@ characters(void *ctx, const xmlChar *ch, int len) #else xmlTextConcat(lastChild, ch, len); #endif - } else if (isText) { + } else if (coalesceText) { xmlTextConcat(lastChild, ch, len); if (ctxt->node->children != NULL) { ctxt->nodelen = xmlStrlen(lastChild->content); diff --git a/nanoftp.c b/nanoftp.c index c8ff2617..bb6bae6b 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -1220,6 +1220,7 @@ xmlNanoFTPGetConnection(void *ctx) { struct sockaddr_in dataAddr; SOCKLEN_T dataAddrLen; +retry: ctxt->dataFd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); if (ctxt->dataFd < 0) { xmlGenericError(xmlGenericErrorContext, diff --git a/parser.c b/parser.c index f3086174..9aa091cd 100644 --- a/parser.c +++ b/parser.c @@ -28,9 +28,6 @@ * See Copyright for the status of this software. * * daniel@veillard.com - * - * 14 Nov 2000 ht - truncated definitions of xmlSubstituteEntitiesDefaultValue - * and xmlDoValidityCheckingDefaultValue for VMS */ #include "libxml.h" @@ -5470,7 +5467,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { ctxt->errNo = XML_ERR_NAME_REQUIRED; if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->sax->error(ctxt->userData, - "xmlParseEntityRef: no name\n"); + "xmlParseStringEntityRef: no name\n"); ctxt->wellFormed = 0; ctxt->disableSAX = 1; } else { @@ -5602,7 +5599,7 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { ctxt->errNo = XML_ERR_ENTITYREF_SEMICOL_MISSING; if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL)) ctxt->sax->error(ctxt->userData, - "xmlParseEntityRef: expecting ';'\n"); + "xmlParseStringEntityRef: expecting ';'\n"); ctxt->wellFormed = 0; ctxt->disableSAX = 1; }