Synch to No Gnus 200510200130.
authoryamaoka <yamaoka>
Thu, 20 Oct 2005 01:30:52 +0000 (01:30 +0000)
committeryamaoka <yamaoka>
Thu, 20 Oct 2005 01:30:52 +0000 (01:30 +0000)
lisp/ChangeLog
lisp/rfc2047.el

index dc6b2e7..900cdc3 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-20  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * rfc2047.el (rfc2047-decode-encoded-words): Fix the handling of
+       errors.
+
 2005-10-19  Reiner Steib  <Reiner.Steib@gmx.de>
 
        * mm-bodies.el (mm-decode-string): Call
index 3ce10e5..3822c8a 100644 (file)
@@ -834,7 +834,7 @@ ENCODED-WORD)."
                         ((char-equal ?Q (nth 1 word))
                          (setq text (quoted-printable-decode-string
                                      (mm-subst-char-in-string
-                                      ?_ ? (nth 2 word) t)))))
+                                      ?_ ?  (nth 2 word) t)))))
                 (error
                  (message "%s" (error-message-string code))
                  nil)))
@@ -845,7 +845,7 @@ ENCODED-WORD)."
            (push (cons cs text) rest))
        ;; Don't decode encoded-word.
        (push (cons nil (nth 3 word)) rest)))
-    (setq words "")
+    (setq words nil)
     (while rest
       (setq words (concat
                   (or (and (setq cs (caar rest))
@@ -856,7 +856,9 @@ ENCODED-WORD)."
                               nil)))
                       (concat (when (cdr rest) " ")
                               (cdar rest)
-                              (unless (string-equal words "") " ")))
+                              (when (and words
+                                         (not (eq (string-to-char words) ? )))
+                                " ")))
                   words)
            rest (cdr rest)))
     words))