commit 7eeff59c10b2c8654594baf4f38ebeebdd8bc270
parent 52f67e05ec4e1f882be166917c74a28617fe4fa6
Author: libredev <libredev@ircforever.org>
Date: Sun, 8 Jan 2023 16:15:38 +0530
format comment email
Diffstat:
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/comment.c b/comment.c
@@ -106,9 +106,18 @@ comment_list_print(struct comment_list *clist)
puts("<h2> Comments: </h2>");
puts("<hr>");
for (it = clist; it != NULL; it = it->next) {
- printf("<p><b>%s</b>%s</p>\n",
- it->name ? it->name : "Anonymous",
- it->email ? it->email : "");
+ printf("<p>");
+
+ if (it->email == NULL)
+ printf("<b>Anonymous</b>");
+ else
+ printf("<b>%s</b>", it->name);
+
+ if (it->email != NULL)
+ printf(" <%s>", it->email);
+
+ printf("</p>\n");
+
printf("<pre>%s</pre>\n", it->body);
puts("<hr>");
}