Importing Pterodactyl Gnus v0.87.
[elisp/gnus.git-] / lisp / mm-bodies.el
index 79afd06..bcbd4f1 100644 (file)
@@ -161,7 +161,14 @@ If no encoding was done, nil is returned."
           ((eq encoding 'quoted-printable)
            (quoted-printable-decode-region (point-min) (point-max)))
           ((eq encoding 'base64)
-           (base64-decode-region (point-min) (point-max)))
+           (base64-decode-region (point-min)
+                                 ;; Some mailers insert whitespace
+                                 ;; junk at the end which
+                                 ;; base64-decode-region dislikes.
+                                 (save-excursion
+                                   (goto-char (point-max))
+                                   (skip-chars-backward "\n\t ")
+                                   (point))))
           ((memq encoding '(7bit 8bit binary))
            )
           ((null encoding)