(list_message): Output an extra newline only
if the formatted buffer does not ends with one.
Showing
1 changed file
with
6 additions
and
1 deletions
... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment