sfeed

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

commit d36499baf81f5aacdad2de0937f2ee10e1cb1350
parent 5cef3ce66158875d25f5d7606a260ff449fb866a
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Mon, 22 Apr 2019 14:21:07 +0200

sfeed_atom: if the link is empty, don't print it

Diffstat:
Msfeed_atom.c | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/sfeed_atom.c b/sfeed_atom.c @@ -40,9 +40,12 @@ printfeed(FILE *fp, const char *feedname) fputs("] ", stdout); } xmlencode(fields[FieldTitle], stdout); - fputs("</title>\n\t<link rel=\"alternate\" href=\"", stdout); - xmlencode(fields[FieldLink], stdout); - fputs("\" />\n", stdout); + fputs("</title>\n", stdout); + if (fields[FieldLink][0]) { + fputs("\t<link rel=\"alternate\" href=\"", stdout); + xmlencode(fields[FieldLink], stdout); + fputs("\" />\n", stdout); + } if (fields[FieldEnclosure][0]) { fputs("\t<link rel=\"enclosure\" href=\"", stdout); xmlencode(fields[FieldEnclosure], stdout);