diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-04-30 00:31:59 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2019-04-30 00:31:59 +0200 |
commit | 6341524d8587aba6b647de9798941aa9e6db6cfc (patch) | |
tree | 3b92e4e5b0f6fab4a86a20bd78d01927c05d8289 /sfeed_html.c | |
parent | f4b03f5a7efb846d3fa6d17ee3279ab172e66e3c (diff) |
sfeed_frames, sfeed_html: use the same code for link handling
Diffstat (limited to 'sfeed_html.c')
-rw-r--r-- | sfeed_html.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sfeed_html.c b/sfeed_html.c index 56d56bf..e337d40 100644 --- a/sfeed_html.c +++ b/sfeed_html.c @@ -21,7 +21,7 @@ printfeed(FILE *fp, struct feed *f) char *fields[FieldLast]; struct tm *tm; time_t parsedtime; - unsigned int islink, isnew; + unsigned int isnew; ssize_t linelen; if (f->name[0]) { @@ -47,8 +47,6 @@ printfeed(FILE *fp, struct feed *f) err(1, "localtime"); isnew = (parsedtime >= comparetime) ? 1 : 0; - islink = fields[FieldLink][0] ? 1 : 0; - totalnew += isnew; f->totalnew += isnew; f->total++; @@ -58,14 +56,15 @@ printfeed(FILE *fp, struct feed *f) tm->tm_hour, tm->tm_min); if (isnew) fputs("<b><u>", stdout); - if (islink) { + if (fields[FieldLink][0]) { fputs("<a href=\"", stdout); xmlencode(fields[FieldLink], stdout); fputs("\">", stdout); - } - xmlencode(fields[FieldTitle], stdout); - if (islink) + xmlencode(fields[FieldTitle], stdout); fputs("</a>", stdout); + } else { + xmlencode(fields[FieldTitle], stdout); + } if (isnew) fputs("</u></b>", stdout); fputs("\n", stdout); |