summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2014-06-28 15:53:32 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2014-06-28 15:53:32 +0200
commita869ac25e174b7179f13557dd0a23840bf2cf327 (patch)
tree305479c14ab943d563f74b0d9a8786fae4c0deed
parent97a069df32404705b9c5782cae338a0ea39f4535 (diff)
sfeed: fix check for div in atom content
as suspected it should match the tagname exactly "div", it would match <diva> too :P Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
-rw-r--r--sfeed.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sfeed.c b/sfeed.c
index 70ab46a..416dbfa 100644
--- a/sfeed.c
+++ b/sfeed.c
@@ -499,11 +499,12 @@ xml_handler_attr(XMLParser *p, const char *tag, size_t taglen,
static void
xml_handler_start_element(XMLParser *p, const char *name, size_t namelen) {
if(ctx.iscontenttag) {
- /* starts with div, handle as XML, don't convert entities */
- /* TODO: test properly */
+ /* starts with div, handle as XML, don't convert entities (set handle to NULL) */
if(ctx.item.feedtype == FeedTypeAtom &&
- !strncmp(name, "div", strlen("div"))) /* TODO: strncmp -> strcmp? */
+ namelen == strlen("div") &&
+ !strncmp(name, "div", strlen("div"))) {
p->xmldataentity = NULL;
+ }
}
if(ctx.iscontent) {
ctx.attrcount = 0;