--- lib-src/b2m.c.qdist 2006-04-04 00:13:01.000000000 -0400 +++ lib-src/b2m.c 2009-07-06 16:42:11.000000000 -0400 @@ -94,7 +94,7 @@ int argc; char **argv; { - logical labels_saved, printing, header; + logical labels_saved, printing, header, first, last_was_blank_line; time_t ltoday; struct tm *tm; char *labels, *p, *today; @@ -139,7 +139,8 @@ exit (EXIT_SUCCESS); } - labels_saved = printing = header = FALSE; + labels_saved = printing = header = last_was_blank_line = FALSE; + first = TRUE; ltoday = time (0); /* Convert to a string, checking for out-of-range time stamps. Don't use 'ctime', as that might dump core if the hardware clock @@ -166,6 +167,13 @@ if (data.buffer[0] == '\037') { + if (first) + first = FALSE; + else + { + if (! last_was_blank_line) + puts(""); + } if (data.buffer[1] == '\0') continue; else if (data.buffer[1] == '\f') @@ -195,7 +203,13 @@ } if (printing) - puts (data.buffer); + { + puts (data.buffer); + if (data.buffer[0] == '\0') + last_was_blank_line = TRUE; + else + last_was_blank_line = FALSE; + } } return EXIT_SUCCESS; --- lisp/mail/unrmail.el.qdist 2009-04-10 17:02:58.000000000 -0400 +++ lisp/mail/unrmail.el 2009-07-06 16:43:20.000000000 -0400 @@ -232,6 +232,12 @@ (while (search-forward "\nFrom " nil t) (forward-char -5) (insert ?>))) + ;; Make sure the message ends with two newlines + (goto-char (point-max)) + (insert "\n") + (goto-char (- (point-max) 3)) + (if (looking-at "\n\n\n") + (delete-region (point) (1+ (point)))) ;; Write it to the output file, suitably encoded. (let ((coding-system-for-write coding)) (write-region (point-min) (point-max) to-file t