changeset 53666:0a56d6bd40da

(rmail-convert-to-babyl-format): Avoid deleting trailing white space and ensure a final newline.
author Markus Rost <rost@math.uni-bielefeld.de>
date Wed, 21 Jan 2004 12:35:55 +0000
parents c1b91f41e667
children 697108aea01d
files lisp/mail/rmail.el
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Wed Jan 21 12:35:11 2004 +0000
+++ b/lisp/mail/rmail.el	Wed Jan 21 12:35:55 2004 +0000
@@ -1890,7 +1890,13 @@
 		       (when
 			   (condition-case nil
 			       (progn
-				 (base64-decode-region (1+ header-end) (point))
+				 (base64-decode-region
+				  (1+ header-end)
+				  (save-excursion
+				    ;; Prevent base64-decode-region
+				    ;; from removing newline characters.
+				    (skip-chars-backward "\n\t ")
+				    (point)))
 				 t)
 			     (error nil))
 			 (goto-char header-end)
@@ -1908,6 +1914,7 @@
 		   (goto-char (point-min))
 		   (while (search-forward "\n\^_" nil t); single char
 		     (replace-match "\n^_")))); 2 chars: "^" and "_"
+	       (or (bolp) (newline)) ; in case we lost the final newline.
 	       (insert ?\^_)
 	       (setq last-coding-system-used nil)
 	       (or rmail-enable-mime