Synch with Gnus.
authoryamaoka <yamaoka>
Thu, 9 Nov 2000 22:05:21 +0000 (22:05 +0000)
committeryamaoka <yamaoka>
Thu, 9 Nov 2000 22:05:21 +0000 (22:05 +0000)
lisp/ChangeLog
lisp/gnus-srvr.el
lisp/rfc2047.el

index 2fb269c..3161f7b 100644 (file)
@@ -1,3 +1,13 @@
+2000-11-09 16:20:37  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * rfc2047.el (rfc2047-pad-base64): New function.
+       (rfc2047-decode): Use it.
+
+2000-11-09 08:53:04  ShengHuo ZHU  <zsh@cs.rochester.edu>
+
+       * gnus-srvr.el (gnus-browse-foreign-server): Bind the original
+       select method.
+
 2000-11-08 19:58:58  ShengHuo ZHU  <zsh@cs.rochester.edu>
 
        * mml2015.el (mml2015-gpg-decrypt-1): 
index eb31093..8182382 100644 (file)
@@ -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)))
index fa18f9d..081da41 100644 (file)
@@ -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 ?_ ? )))