changeset 77699:1608babbc1ce

(rmail-convert-to-babyl-format): Check content-transfer-encoding _last_, because it's its position that we need in base64-header-field-end.
author Eli Zaretskii <eliz@gnu.org>
date Mon, 14 May 2007 19:48:30 +0000
parents 18bb2e9c5f52
children f02b6b4076ae
files lisp/mail/rmail.el
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Mon May 14 10:36:51 2007 +0000
+++ b/lisp/mail/rmail.el	Mon May 14 19:48:30 2007 +0000
@@ -1959,12 +1959,13 @@
 			(base64-header-field-end
 			 (save-excursion
 			   (goto-char start)
+			   ;; Don't try to decode non-text data.
 			   (and (re-search-forward
-				 "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
+				 "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/"
 				 header-end t)
-				;; Don't try to decode non-text data.
+				(goto-char start)
 				(re-search-forward
-				 "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/"
+				 "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
 				 header-end t)))))
 		   (if quoted-printable-header-field-end
 		       (save-excursion
@@ -2066,14 +2067,14 @@
 			  header-end t)))
 		      (base64-header-field-end
 		       (and
-			(save-excursion
-			  (re-search-forward
-			   "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
-			   header-end t))
 			;; Don't decode non-text data.
 			(save-excursion
 			  (re-search-forward
 			   "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/"
+			   header-end t))
+			(save-excursion
+			  (re-search-forward
+			   "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
 			   header-end t))))
 		      (size
 		       ;; Get the numeric value from the Content-Length field.