sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit dfb02b659a44afe34176d010846de5c09992a147
parent 07a9a6d5c711426af787ffc38d16b9147062ab8a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue, 11 Jun 2019 20:50:16 +0200

optimization: only convert entities when we are inside a RSS/Atom tag

Diffstat:
Msfeed.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sfeed.c b/sfeed.c @@ -671,6 +671,11 @@ xmlattrentity(XMLParser *p, const char *t, size_t tl, const char *n, size_t nl, return; } + if (!ctx.tagid) + return; + + /* try to translate entity, else just pass as data to + * xmldata handler. */ if ((len = xml_entitytostr(data, buf, sizeof(buf))) > 0) xmlattr(p, t, tl, n, nl, buf, (size_t)len); else @@ -735,7 +740,7 @@ xmldataentity(XMLParser *p, const char *data, size_t datalen) return; /* try to translate entity, else just pass as data to - * xml_data_handler. */ + * xmldata handler. */ if ((len = xml_entitytostr(data, buf, sizeof(buf))) > 0) xmldata(p, buf, (size_t)len); else