aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-10-07 00:49:16 -0700
committerGlenn Morris2012-10-07 00:49:16 -0700
commit99a1e701100ef02907d2ab64a7f05024bc2983be (patch)
treea7ae0455eefcd47777f6bf33eb17dec8bba72835
parent08f18c3d4d86ba60c9f31512c310fffd1a60f9eb (diff)
downloademacs-99a1e701100ef02907d2ab64a7f05024bc2983be.tar.gz
emacs-99a1e701100ef02907d2ab64a7f05024bc2983be.zip
Fix infloop in rmailmm on multipart messages with epilogues
* lisp/mail/rmailmm.el (rmail-mime-process-multipart): Do not confuse a multipart message with an epilogue with a "truncated" one; fixes 2011-06-27 change. Fixes: debbugs:10101
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/mail/rmailmm.el13
2 files changed, 16 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d138e6c84fa..e54e82233a2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-10-07 Glenn Morris <rgm@gnu.org>
2
3 * mail/rmailmm.el (rmail-mime-process-multipart):
4 Do not confuse a multipart message with an epilogue
5 with a "truncated" one; fixes 2011-06-27 change. (Bug#10101)
6
12012-10-07 Fabián Ezequiel Gallina <fgallina@cuca> 72012-10-07 Fabián Ezequiel Gallina <fgallina@cuca>
2 8
3 Fix shell output retrieval and comint-prompt-regexp init. 9 Fix shell output retrieval and comint-prompt-regexp init.
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 2cc57963ef7..11bccd59765 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -832,7 +832,7 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
832 (let ((boundary (cdr (assq 'boundary content-type))) 832 (let ((boundary (cdr (assq 'boundary content-type)))
833 (subtype (cadr (split-string (car content-type) "/"))) 833 (subtype (cadr (split-string (car content-type) "/")))
834 (index 0) 834 (index 0)
835 beg end next entities truncated) 835 beg end next entities truncated last)
836 (unless boundary 836 (unless boundary
837 (rmail-mm-get-boundary-error-message 837 (rmail-mm-get-boundary-error-message
838 "No boundary defined" content-type content-disposition 838 "No boundary defined" content-type content-disposition
@@ -867,7 +867,13 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
867 ;; Handle the rest of the truncated message 867 ;; Handle the rest of the truncated message
868 ;; (if it isn't empty) by pretending that the boundary 868 ;; (if it isn't empty) by pretending that the boundary
869 ;; appears at the end of the message. 869 ;; appears at the end of the message.
870 (and (save-excursion 870 ;; We use `last' to distinguish this from the more
871 ;; likely situation of there being an epilogue
872 ;; after the last boundary, which should be ignored.
873 ;; See rmailmm-test-multipart-handler for an example,
874 ;; and also bug#10101.
875 (and (not last)
876 (save-excursion
871 (skip-chars-forward "\n") 877 (skip-chars-forward "\n")
872 (> (point-max) (point))) 878 (> (point-max) (point)))
873 (setq truncated t end (point-max)))) 879 (setq truncated t end (point-max))))
@@ -875,7 +881,8 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
875 ;; epilogue, else hide the boundary only. Use a marker for 881 ;; epilogue, else hide the boundary only. Use a marker for
876 ;; `next' because `rmail-mime-show' may change the buffer. 882 ;; `next' because `rmail-mime-show' may change the buffer.
877 (cond ((looking-at "--[ \t]*$") 883 (cond ((looking-at "--[ \t]*$")
878 (setq next (point-max-marker))) 884 (setq next (point-max-marker)
885 last t))
879 ((looking-at "[ \t]*\n") 886 ((looking-at "[ \t]*\n")
880 (setq next (copy-marker (match-end 0) t))) 887 (setq next (copy-marker (match-end 0) t)))
881 (truncated 888 (truncated