changeset 52988:f2e9f66ff625

(rmail-convert-to-babyl-format): If base64-decode-region signals an error, catch it and silently ignore it.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 03 Nov 2003 19:20:23 +0000
parents ac21698ba968
children 19e82580b6a5
files lisp/mail/rmail.el
diffstat 1 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Mon Nov 03 14:44:48 2003 +0000
+++ b/lisp/mail/rmail.el	Mon Nov 03 19:20:23 2003 +0000
@@ -1687,17 +1687,19 @@
 			 (delete-region (point) (search-backward ":"))
 			 (insert ": 8bit")))
 		   (if base64-header-field-end
-		       (save-excursion
-			 (base64-decode-region (1+ header-end)
-					       (- (point) 2))
-			 ;; Change "base64" to "8bit", to reflect the
-			 ;; decoding we just did.
-			 (goto-char (1+ header-end))
-			 (while (search-forward "\r\n" (point-max) t)
-			   (replace-match "\n"))
-			 (goto-char base64-header-field-end)
-			 (delete-region (point) (search-backward ":"))
-			 (insert ": 8bit")))
+		       (condition-case nil
+			   (save-excursion
+			     (base64-decode-region (1+ header-end)
+						   (- (point) 2))
+			     ;; Change "base64" to "8bit", to reflect the
+			     ;; decoding we just did.
+			     (goto-char (1+ header-end))
+			     (while (search-forward "\r\n" (point-max) t)
+			       (replace-match "\n"))
+			     (goto-char base64-header-field-end)
+			     (delete-region (point) (search-backward ":"))
+			     (insert ": 8bit"))
+			 (error nil)))
 		   (setq last-coding-system-used nil)
 		   (or rmail-enable-mime
 		       (not rmail-enable-multibyte)
@@ -1827,13 +1829,15 @@
 		       (delete-region (point) (search-backward ":"))
 		       (insert ": 8bit")))
 		 (if base64-header-field-end
-		     (save-excursion
-		       (base64-decode-region header-end (point))
-		       ;; Change "base64" to "8bit", to reflect the
-		       ;; decoding we just did.
-		       (goto-char base64-header-field-end)
-		       (delete-region (point) (search-backward ":"))
-		       (insert ": 8bit"))))
+		     (condition-case nil
+			 (save-excursion
+			   (base64-decode-region header-end (point))
+			   ;; Change "base64" to "8bit", to reflect the
+			   ;; decoding we just did.
+			   (goto-char base64-header-field-end)
+			   (delete-region (point) (search-backward ":"))
+			   (insert ": 8bit"))
+		       (error nil))))
 
 	       (save-excursion
 		 (save-restriction