From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67975 Path: news.gmane.org!not-for-mail From: Michael Olson Newsgroups: gmane.emacs.gnus.general Subject: [PATCH] Fix edge cases with no data being returned and Courier eccentricity. Date: Tue, 23 Dec 2008 09:47:36 -0800 Message-ID: <87ocz2iy13.fsf@grepfind.mwolson.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230054760 28954 80.91.229.12 (23 Dec 2008 17:52:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 23 Dec 2008 17:52:40 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16421@lists.math.uh.edu Tue Dec 23 18:53:46 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1LFBRm-00073s-Gy for ding-account@gmane.org; Tue, 23 Dec 2008 18:53:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1LFBQ4-0000LQ-3z; Tue, 23 Dec 2008 11:51:48 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1LFBM8-0000Jy-T3 for ding@lists.math.uh.edu; Tue, 23 Dec 2008 11:47:44 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LFBM5-0002hZ-HZ for ding@lists.math.uh.edu; Tue, 23 Dec 2008 11:47:44 -0600 Original-Received: from deleuze.hcoop.net ([69.90.123.67] ident=Debian-exim) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LFBMI-0002Pj-00 for ; Tue, 23 Dec 2008 18:47:55 +0100 Original-Received: from cpe-98-154-252-107.socal.res.rr.com ([98.154.252.107] helo=grepfind.mwolson.org) by deleuze.hcoop.net with esmtpsa (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1LFBM2-0004mc-W6 for ding@gnus.org; Tue, 23 Dec 2008 12:47:39 -0500 Original-Received: from mwolson by grepfind.mwolson.org with local (Exim 4.69) (envelope-from ) id 1LFBM1-0005ce-9j for ding@gnus.org; Tue, 23 Dec 2008 09:47:37 -0800 X-Hashcash: 1:20:081223:ding@gnus.org::eo+DtSlKAN6Zl0M+:00002gbl User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67975 Archived-At: * 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. --- NOTE: This patch applies to Emacs CVS HEAD. lisp/gnus/nnimap.el | 9 +++++---- lisp/net/imap.el | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index e0bb5ad..a38d354 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -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" diff --git a/lisp/net/imap.el b/lisp/net/imap.el index 6726bfd..3c51895 100644 --- a/lisp/net/imap.el +++ b/lisp/net/imap.el @@ -2493,7 +2493,8 @@ 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 (progn (skip-chars-forward " \t") + (not (eq (char-after) ?\)))) (imap-forward) (let ((token (read (current-buffer)))) (imap-forward) -- 1.5.6.3 -- | Michael Olson | FSF Associate Member #652 | | http://mwolson.org/ | Hobbies: Lisp, HCoop | | Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner | `-------------------------------------------------------'