[gnus git] branch master updated: n0-13-66-g5d27dd6 =1= Work around numbers too big to be read.

Tassilo Horn <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  5d27dd6484d1c20d7f8c22d15c84423ff74594f2 (commit)
      from  ece58aba9e4c143043495d8e496b578aae3fcdc4 (commit)


- Log -----------------------------------------------------------------
commit 5d27dd6484d1c20d7f8c22d15c84423ff74594f2
Author: Tassilo Horn <[email protected]>
Date:   Thu Mar 3 09:01:31 2011 +0100

    Work around numbers too big to be read.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e781286..0df7629 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-03  Tassilo Horn  <[email protected]>
+
+	* nnimap.el (nnimap-parse-flags): Add a workaround for FETCH lines with
+	numbers too big to be `read'.
+
 2011-03-02  Teodor Zlatanov  <[email protected]>
 
 	* password-cache.el (password-in-cache-p): Add autoload.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index c579261..aa4ecbc 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1496,10 +1496,22 @@ textual parts.")
 	    (setq start (point))
 	    (goto-char end))
 	  (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
-	    (setq elems (read (current-buffer)))
+	    (let ((p (point)))
+	      ;; FIXME: For FETCH lines like "* 2971 FETCH (FLAGS (%Recent) UID
+	      ;; 12509 MODSEQ (13419098521433281274))" we get an
+	      ;; overflow-error.  The handler simply deletes that large number
+	      ;; and reads again.  But maybe there's a better fix...
+	      (setq elems (condition-case nil (read (current-buffer))
+			    (overflow-error
+			     ;; After an overflow-error, point is just after
+			     ;; the too large number.  So delete it and try
+			     ;; again.
+			     (delete-region (point) (progn (backward-word) (point)))
+			     (goto-char p)
+			     (read (current-buffer)))))
 	    (push (cons (cadr (memq 'UID elems))
 			(cadr (memq 'FLAGS elems)))
-		  articles))
+		    articles)))
 	  (push (nconc (list group uidnext totalp permanent-flags uidvalidity
 			     vanished highestmodseq)
 		       articles)

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    5 +++++
 lisp/nnimap.el |   20 ++++++++++++++++----
 2 files changed, 21 insertions(+), 4 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.