From 134a1ac3372fe1eae6bc5c6acd12666c17e82696 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 31 Oct 2020 19:51:17 +0100 Subject: sfeed_web: improve parsing a if it has no type attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This happens because the previous link type is not reset when a tag starts again, but it is reset when a type attribute starts. Found on the spanish newspaper site: elpais.com Input: Would print (second line is incorrect). https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/portada application/rss+xml https://elpais.com/ application/rss+xml Now prints: https://feeds.elpais.com/mrss-s/pages/ep/site/elpais.com/portada application/rss+xml Fix: reset it also at the start of a tag in this case (for it is still not wanted). --- sfeed_web.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sfeed_web.c b/sfeed_web.c index e0ab874..6d547a7 100644 --- a/sfeed_web.c +++ b/sfeed_web.c @@ -32,6 +32,7 @@ xmltagstart(XMLParser *p, const char *t, size_t tl) } else if (!strcasecmp(t, "link")) { islinktag = 1; linkhref[0] = '\0'; + linktype[0] = '\0'; } } -- cgit v1.2.3