From 5c8840493f8cd52ba2224db6ed644f4933ac2212 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 16 May 2015 15:54:39 +0200 Subject: xml: attrentity handler will be called if set it used to be if attrentity is NULL it would call attrdata. --- xml.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xml.c b/xml.c index 9f88792..d2a064d 100644 --- a/xml.c +++ b/xml.c @@ -82,7 +82,7 @@ xmlparser_parseattrs(XMLParser *x) if(x->xmlattrstart) x->xmlattrstart(x, x->tag, x->taglen, x->name, namelen); for(valuelen = 0; (c = xmlparser_getnext(x)) != EOF;) { - if(c == '&' && x->xmlattrentity) { /* entities */ + if(c == '&') { /* entities */ x->data[valuelen] = '\0'; /* call data function with data before entity if there is data */ if(valuelen && x->xmlattr) @@ -104,7 +104,8 @@ xmlparser_parseattrs(XMLParser *x) } if(c == ';') { x->data[valuelen] = '\0'; - x->xmlattrentity(x, x->tag, x->taglen, x->name, namelen, x->data, valuelen); + if(x->xmlattrentity) + x->xmlattrentity(x, x->tag, x->taglen, x->name, namelen, x->data, valuelen); valuelen = 0; break; } @@ -310,7 +311,7 @@ xmlparser_parse(XMLParser *x) if(x->xmldatastart) x->xmldatastart(x); while((c = xmlparser_getnext(x)) != EOF) { - if(c == '&' && x->xmldataentity) { + if(c == '&') { if(datalen) { x->data[datalen] = '\0'; x->xmldata(x, x->data, datalen); @@ -326,7 +327,8 @@ xmlparser_parse(XMLParser *x) break; else if(c == ';') { x->data[datalen] = '\0'; - x->xmldataentity(x, x->data, datalen); + if(x->xmldataentity) + x->xmldataentity(x, x->data, datalen); datalen = 0; break; } -- cgit v1.2.3