(nnimap-insert-partial-structure): Get the type from the correct slot, too.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 29 Sep 2010 19:34:07 +0000 (21:34 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Wed, 29 Sep 2010 19:34:07 +0000 (21:34 +0200)
lisp/ChangeLog
lisp/nnimap.el

index db75270..fa84268 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-29  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * nnimap.el (nnimap-insert-partial-structure): Get the type from the
+       correct slot, too.
+
 2010-09-29  Julien Danjou  <julien@danjou.info>
 
        * gnus-util.el (gnus-icompleting-read): Require iswitchb. Fix history
index c256c8c..5e55142 100644 (file)
@@ -509,14 +509,15 @@ textual parts.")
     t))
 
 (defun nnimap-insert-partial-structure (structure parts &optional subp)
-  (let ((type (car (last structure 4)))
-       (boundary (let ((bstruc structure))
-                   (while (consp (car bstruc))
-                     (pop bstruc))
-                   (setq bstruc (car (cdr bstruc)))
-                   (and (stringp (car bstruc))
-                        (string= (downcase (car bstruc)) "boundary")
-                        (cadr bstruc)))))
+  (let (type boundary)
+    (let ((bstruc structure))
+      (while (consp (car bstruc))
+       (pop bstruc))
+      (setq type (car bstruc))
+      (setq bstruc (car (cdr bstruc)))
+      (when (and (stringp (car bstruc))
+                (string= (downcase (car bstruc)) "boundary"))
+       (setq boundary (cadr bstruc))))
     (when subp
       (insert (format "Content-type: multipart/%s; boundary=%S\n\n"
                      (downcase type) boundary)))