From f4b03f5a7efb846d3fa6d17ee3279ab172e66e3c Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 30 Apr 2019 00:30:33 +0200 Subject: sfeed_gph: when a link is empty show as regular text --- sfeed_gph.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sfeed_gph.c b/sfeed_gph.c index 93f610c..adfa4f8 100644 --- a/sfeed_gph.c +++ b/sfeed_gph.c @@ -75,14 +75,20 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) f->totalnew += isnew; f->total++; - fputs("[h|", fpitems); - fprintf(fpitems, "%04d-%02d-%02d %02d:%02d ", - tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, - tm->tm_hour, tm->tm_min); - gphlink(fpitems, fields[FieldTitle], strlen(fields[FieldTitle])); - fputs("|URL:", fpitems); - gphlink(fpitems, fields[FieldLink], strlen(fields[FieldLink])); - fputs("|server|port]\n", fpitems); + if (fields[FieldLink][0]) { + fputs("[h|", fpitems); + fprintf(fpitems, "%04d-%02d-%02d %02d:%02d ", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min); + gphlink(fpitems, fields[FieldTitle], strlen(fields[FieldTitle])); + fputs("|URL:", fpitems); + gphlink(fpitems, fields[FieldLink], strlen(fields[FieldLink])); + fputs("|server|port]\n", fpitems); + } else { + fprintf(fpitems, "%04d-%02d-%02d %02d:%02d %s\n", + tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, + tm->tm_hour, tm->tm_min, fields[FieldTitle]); + } } } -- cgit v1.2.3