From 1309b40bb5b92ef835ce48cf11c57721a5dbdbe7 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sun, 23 Aug 2015 17:42:37 +0200 Subject: simplify unknown or less priority tag case, fix gettag bug (wrong sort order) --- sfeed.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sfeed.c b/sfeed.c index 6de9d9d..5cff1d5 100644 --- a/sfeed.c +++ b/sfeed.c @@ -149,8 +149,8 @@ gettag(enum FeedType feedtype, const char *name, size_t namelen) { STRP("dc:date"), RSSTagDcdate }, { STRP("description"), RSSTagDescription }, { STRP("guid"), RSSTagGuid }, - { STRP("media:description"), RSSTagMediaDescription }, { STRP("link"), RSSTagLink }, + { STRP("media:description"), RSSTagMediaDescription }, { STRP("pubdate"), RSSTagPubdate }, { STRP("title"), RSSTagTitle }, { NULL, 0, -1 } @@ -622,15 +622,11 @@ xml_handler_start_el(XMLParser *p, const char *name, size_t namelen) /* in item */ tagid = gettag(ctx.feedtype, name, namelen); ctx.tagid = tagid; - if (tagid == TagUnknown) { - ctx.field = NULL; - return; - } - /* map tag type to field */ + /* map tag type to field: unknown or less priority is ignored. */ if (tagid <= ctx.fields[fieldmap[ctx.tagid]].tagid) { ctx.field = NULL; - return; /* priority */ + return; } ctx.iscontenttag = (fieldmap[ctx.tagid] == FieldContent); ctx.field = &(ctx.fields[fieldmap[ctx.tagid]].str); -- cgit v1.2.3