diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-08-23 17:42:37 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-08-23 17:42:37 +0200 |
commit | 1309b40bb5b92ef835ce48cf11c57721a5dbdbe7 (patch) | |
tree | d8748468bd8e26f81db2468890394dd52f3fa8ea | |
parent | 37f5dce067ff8a8445a81b3db53ed3173f39f226 (diff) |
simplify unknown or less priority tag case, fix gettag bug (wrong sort order)
-rw-r--r-- | sfeed.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -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); |