summaryrefslogtreecommitdiff
path: root/sfeed_mbox.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2015-07-31 21:06:52 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2015-07-31 21:12:07 +0200
commit356e7d79925f91b9b703ee63e3680694c53a59a4 (patch)
treebc06b59ee637c2695055b62221abad696d66eb7c /sfeed_mbox.c
parenteb586eda26967183de91c314a57d323b124110bb (diff)
Various improvements
- Only escape characters in "content" field, these can contain newlines. - Trim newlines and tabs, etc from the title, id and author fields. - Make decodefield, xmlencode functions easier to "chain" without allocatting new buffers. - Move printutf8pad from util (only used by sfeed_plain) to sfeed_plain. - Update README, still need to update the man-page and improve the documentation in general. - Code cleanup.
Diffstat (limited to 'sfeed_mbox.c')
-rw-r--r--sfeed_mbox.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sfeed_mbox.c b/sfeed_mbox.c
index 4e203ef..880920d 100644
--- a/sfeed_mbox.c
+++ b/sfeed_mbox.c
@@ -60,12 +60,17 @@ printfeed(FILE *fp, const char *feedname)
fields[FieldContentType], feedname);
if (!strcmp(fields[FieldContentType], "html")) {
- printf("<p>Link: <a href=\"%s\">%s</a></p>\n\n",
- fields[FieldLink], fields[FieldLink]);
- printcontent(fields[FieldContent], stdout);
+ fputs("<p>Link: <a href=\"", stdout);
+ decodefield(fields[FieldLink], stdout, fputc);
+ fputs("\">", stdout);
+ decodefield(fields[FieldLink], stdout, fputc);
+ fputs("</a></p>\n\n", stdout);
+ decodefield(fields[FieldContent], stdout, fputc);
} else {
- printf("Link: %s\n\n", fields[FieldLink]);
- printcontent(fields[FieldContent], stdout);
+ fputs("Link: ", stdout);
+ decodefield(fields[FieldLink], stdout, fputc);
+ fputs("\n\n", stdout);
+ decodefield(fields[FieldContent], stdout, fputc);
}
fputs("\n\n", stdout);
}