diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-04-22 14:21:07 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-04-22 14:21:07 +0200 |
commit | d36499baf81f5aacdad2de0937f2ee10e1cb1350 (patch) | |
tree | 09828ada4dc73c0f186f800962218a6382efec6e | |
parent | 5cef3ce66158875d25f5d7606a260ff449fb866a (diff) |
sfeed_atom: if the link is empty, don't print it
-rw-r--r-- | sfeed_atom.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sfeed_atom.c b/sfeed_atom.c index d9ee099..3040b8c 100644 --- 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); |