(rfc2047-decode-encoded-words): Fix the handling of errors.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 20 Oct 2005 01:30:37 +0000 (01:30 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 20 Oct 2005 01:30:37 +0000 (01:30 +0000)
lisp/ChangeLog
lisp/rfc2047.el

index aad9cc6..a3d79ad 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 17f4d81..b12be82 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))