Commit a2a85ee0 a2a85ee0dd1c404e625dd4a1dab2115c6f0e5f0e by Sergey Poznyakoff

(list_message): Output an extra newline only

if the formatted buffer does not ends with one.
1 parent 7f7770a4
...@@ -283,7 +283,12 @@ void ...@@ -283,7 +283,12 @@ void
283 list_message (mailbox_t mbox, message_t msg, size_t num, void *data) 283 list_message (mailbox_t mbox, message_t msg, size_t num, void *data)
284 { 284 {
285 char *buffer; 285 char *buffer;
286 int len;
287
286 mh_format (&format, msg, num, width, &buffer); 288 mh_format (&format, msg, num, width, &buffer);
287 printf ("%s\n", buffer); 289 printf ("%s", buffer);
290 len = strlen (buffer);
291 if (len > 0 && buffer[len-1] != '\n')
292 printf("\n");
288 free (buffer); 293 free (buffer);
289 } 294 }
......