diff --git a/ChangeLog b/ChangeLog index 5498fe34..56b49dea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 11 11:25:36 CEST 2001 Daniel Veillard + + * parser.c result/noent/wml.xml: fixed bug #59981 related + to handling of '&' in attributes when entities are substitued + Mon Sep 10 22:14:42 CEST 2001 Daniel Veillard * libxml.h include/libxml/xmlversion.h.in diff --git a/parser.c b/parser.c index 6510a49c..38d6d6c6 100644 --- a/parser.c +++ b/parser.c @@ -2212,36 +2212,50 @@ xmlParseAttValue(xmlParserCtxtPtr ctxt) { (c != '<')) || (ctxt->token != 0)) { if (c == 0) break; if (ctxt->token == '&') { - /* - * The reparsing will be done in xmlStringGetNodeList() - * called by the attribute() function in SAX.c - */ - static xmlChar buffer[6] = "&"; + if (ctxt->replaceEntities) { + if (len > buf_size - 10) { + growBuffer(buf); + } + buf[len++] = '&'; + } else { + /* + * The reparsing will be done in xmlStringGetNodeList() + * called by the attribute() function in SAX.c + */ + static xmlChar buffer[6] = "&"; - if (len > buf_size - 10) { - growBuffer(buf); + if (len > buf_size - 10) { + growBuffer(buf); + } + current = &buffer[0]; + while (*current != 0) { /* non input consuming */ + buf[len++] = *current++; + } + ctxt->token = 0; } - current = &buffer[0]; - while (*current != 0) { /* non input consuming */ - buf[len++] = *current++; - } - ctxt->token = 0; } else if (c == '&') { if (NXT(1) == '#') { int val = xmlParseCharRef(ctxt); if (val == '&') { - /* - * The reparsing will be done in xmlStringGetNodeList() - * called by the attribute() function in SAX.c - */ - static xmlChar buffer[6] = "&"; + if (ctxt->replaceEntities) { + if (len > buf_size - 10) { + growBuffer(buf); + } + buf[len++] = '&'; + } else { + /* + * The reparsing will be done in xmlStringGetNodeList() + * called by the attribute() function in SAX.c + */ + static xmlChar buffer[6] = "&"; - if (len > buf_size - 10) { - growBuffer(buf); - } - current = &buffer[0]; - while (*current != 0) { /* non input consuming */ - buf[len++] = *current++; + if (len > buf_size - 10) { + growBuffer(buf); + } + current = &buffer[0]; + while (*current != 0) { /* non input consuming */ + buf[len++] = *current++; + } } } else { if (len > buf_size - 10) { diff --git a/result/noent/wml.xml b/result/noent/wml.xml index 55e20ff6..3a965624 100644 --- a/result/noent/wml.xml +++ b/result/noent/wml.xml @@ -3,7 +3,7 @@

- Cinéma
+ Cinéma