]> code.delx.au - gnu-emacs/commitdiff
Gnus: Fix edge cases with no data being returned and Courier eccentricity.
authorMichael Olson <mwolson@gnu.org>
Sat, 3 Jan 2009 23:05:42 +0000 (23:05 +0000)
committerMichael Olson <mwolson@gnu.org>
Sat, 3 Jan 2009 23:05:42 +0000 (23:05 +0000)
* lisp/gnus/nnimap.el (nnimap-retrieve-headers-progress): Handle edge
  case where `headers' is nil.  This can occur if the IMAP server does
  not have permissions to read messages from a folder, but can write new
  messages to the folder.
  (nnimap-request-article-part): Do not insert `data' if it is nil.

* lisp/net/imap.el (imap-parse-fetch): Courier can insert spurious blank
  characters which will confuse `read', so skip past them.

lisp/gnus/nnimap.el
lisp/net/imap.el

index e0bb5ad48f298833ac5062d448d8865bd4616257..a38d35444a36baa6a4a2692be688621e1cfe0e7f 100644 (file)
@@ -620,7 +620,7 @@ If EXAMINE is non-nil the group is selected read-only."
        ;; to make it more clear.
        (mm-with-unibyte-buffer
         (buffer-disable-undo)
-        (insert headers)
+        (when headers (insert headers))
         (let ((head (nnheader-parse-naked-head uid)))
           (mail-header-set-number head uid)
           (mail-header-set-chars head chars)
@@ -950,9 +950,10 @@ function is generally only called when Gnus is shutting down."
              (erase-buffer)
              (let ((data (imap-fetch article part prop nil
                                      nnimap-server-buffer)))
-               (insert (nnimap-demule (if detail
-                                          (nth 2 (car data))
-                                        data))))
+               (when data
+                 (insert (nnimap-demule (if detail
+                                            (nth 2 (car data))
+                                          data)))))
              (nnheader-ms-strip-cr)
              (gnus-message
               10 "nnimap: Fetching (part of) article %d from %s...done"
index 6726bfda200019353273a4d3d341d40537d28d31..85afffc100b682c2ad954df6b2c7bea15469f020 100644 (file)
@@ -2493,7 +2493,9 @@ Return nil if no complete line has arrived."
   (when (eq (char-after) ?\()
     (let (uid flags envelope internaldate rfc822 rfc822header rfc822text
              rfc822size body bodydetail bodystructure flags-empty)
-      (while (not (eq (char-after) ?\)))
+      (while (let ((moved (skip-chars-forward " \t")))
+              (prog1 (not (eq (char-after) ?\)))
+                (unless (= moved 0) (backward-char))))
        (imap-forward)
        (let ((token (read (current-buffer))))
          (imap-forward)