From 57520d6701f4fbbe866b653d4fd209442835a100 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 9 Nov 2000 22:05:21 +0000 Subject: [PATCH] Synch with Gnus. --- lisp/ChangeLog | 10 ++++++++++ lisp/gnus-srvr.el | 16 +++++++++------- lisp/rfc2047.el | 14 +++++++++++++- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2fb269c..3161f7b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2000-11-09 16:20:37 ShengHuo ZHU + + * rfc2047.el (rfc2047-pad-base64): New function. + (rfc2047-decode): Use it. + +2000-11-09 08:53:04 ShengHuo ZHU + + * gnus-srvr.el (gnus-browse-foreign-server): Bind the original + select method. + 2000-11-08 19:58:58 ShengHuo ZHU * mml2015.el (mml2015-gpg-decrypt-1): diff --git a/lisp/gnus-srvr.el b/lisp/gnus-srvr.el index eb31093..8182382 100644 --- a/lisp/gnus-srvr.el +++ b/lisp/gnus-srvr.el @@ -660,13 +660,15 @@ The following commands are available: (insert (format "%c%7d: %s\n" (let ((level - (gnus-group-level - (gnus-group-prefixed-name (car group) method)))) - (cond - ((<= level gnus-level-subscribed) ? ) - ((<= level gnus-level-unsubscribed) ?U) - ((= level gnus-level-zombie) ?Z) - (t ?K))) + (let ((gnus-select-method orig-select-method)) + (gnus-group-level + (gnus-group-prefixed-name (car group) + method))))) + (cond + ((<= level gnus-level-subscribed) ? ) + ((<= level gnus-level-unsubscribed) ?U) + ((= level gnus-level-zombie) ?Z) + (t ?K))) (max 0 (- (1+ (cddr group)) (cadr group))) (gnus-group-name-decode (car group) charset)))) (list 'gnus-group (car group))) diff --git a/lisp/rfc2047.el b/lisp/rfc2047.el index fa18f9d..081da41 100644 --- a/lisp/rfc2047.el +++ b/lisp/rfc2047.el @@ -476,6 +476,17 @@ Return WORD if not." (error word)) word))) +(defun rfc2047-pad-base64 (string) + "Pad STRING to quartets." + ;; Be more liberal to accept buggy base64 strings. If + ;; base64-decode-string accepts buggy strings, this function could + ;; be aliased to identity. + (case (mod (length string) 4) + (0 string) + (1 string) ;; Error, don't pad it. + (2 (concat string "==")) + (3 (concat string "=")))) + (defun rfc2047-decode (charset encoding string) "Decode STRING that uses CHARSET with ENCODING. Valid ENCODINGs are \"B\" and \"Q\". @@ -501,7 +512,8 @@ If your Emacs implementation can't decode CHARSET, it returns nil." (mm-decode-coding-string (cond ((equal "B" encoding) - (base64-decode-string string)) + (base64-decode-string + (rfc2047-pad-base64 string))) ((equal "Q" encoding) (quoted-printable-decode-string (mm-replace-chars-in-string string ?_ ? ))) -- 1.7.10.4