two small improvements Daniel

* dict.c xmlreader.c: two small improvements
Daniel
This commit is contained in:
Daniel Veillard 2003-09-17 21:27:31 +00:00
parent a66b1d1a7d
commit ccc4d2b62e
3 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Wed Sep 17 23:25:47 CEST 2003 Daniel Veillard <daniel@veillard.com>
* dict.c xmlreader.c: two small improvements
Wed Sep 17 22:53:32 CEST 2003 Daniel Veillard <daniel@veillard.com>
* parserInternals.c: avoid a leak with previous patch

3
dict.c
View File

@ -338,6 +338,9 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
if ((dict == NULL) || (name == NULL))
return(NULL);
if ((name[len] == 0) && (xmlDictOwns(dict, name) == 1))
return(name);
if (len < 0)
len = xmlStrlen(name);

View File

@ -1272,6 +1272,7 @@ node_found:
* If we are in the middle of a piece of CDATA make sure it's finished
*/
if ((reader->node != NULL) &&
(reader->node->next == NULL) &&
((reader->node->type == XML_TEXT_NODE) ||
(reader->node->type == XML_CDATA_SECTION_NODE))) {
xmlTextReaderExpand(reader);