[gnus git] branch master updated: n0-13-111-ge4829ab =4= Protect against trying to restore window configurations containing buffers that are now dead. ; Store HIGHESTMODSEQ as a string, since it may be too large for 32-bit Emacsen. ; (nnimap-parse-flags): Simplify the last change. ; Remove all MODSEQ entries before parsing to avoid integer overflows.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  e4829ab95d1a0d3764b6c4e860877a1b0c17c670 (commit)
       via  af55f6a791be2583b4da0228aaeecc06f722878e (commit)
       via  704c61d7d20e685228107477c22d2ffa84d12eed (commit)
       via  d74efc755ffa6170bac7b763e0c4829e2142b3e6 (commit)
      from  593e88e819db92fd8297a062aa3e47e6e3b775e8 (commit)


- Log -----------------------------------------------------------------
commit e4829ab95d1a0d3764b6c4e860877a1b0c17c670
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Mar 15 19:08:44 2011 +0100

    Protect against trying to restore window configurations containing buffers that are now dead.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c83ac33..398086d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2011-03-15  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* gnus-win.el (gnus-configure-frame): Protect against trying to restore
+	window configurations containing buffers that are now dead.
+
 	* nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
 	parsing to avoid integer overflows.
 	(nnimap-parse-flags): Simplify the last change.
diff --git a/lisp/gnus-win.el b/lisp/gnus-win.el
index 156f9a0..c38f57d 100644
--- a/lisp/gnus-win.el
+++ b/lisp/gnus-win.el
@@ -268,8 +268,10 @@ See the Gnus manual for an explanation of the syntax used.")
 	    (error "Invalid buffer type: %s" type))
 	  (let ((buf (gnus-get-buffer-create
 		      (gnus-window-to-buffer-helper buffer))))
-	    (if (eq buf (window-buffer (selected-window))) (set-buffer buf)
-	      (switch-to-buffer buf)))
+	    (when (buffer-name buf)
+	      (if (eq buf (window-buffer (selected-window)))
+		  (set-buffer buf)
+		(switch-to-buffer buf))))
 	  (when (memq 'frame-focus split)
 	    (setq gnus-window-frame-focus window))
 	  ;; We return the window if it has the `point' spec.

commit af55f6a791be2583b4da0228aaeecc06f722878e
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Mar 15 17:58:49 2011 +0100

    Store HIGHESTMODSEQ as a string, since it may be too large for 32-bit Emacsen.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index dd1ec97..c83ac33 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -3,6 +3,8 @@
 	* nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
 	parsing to avoid integer overflows.
 	(nnimap-parse-flags): Simplify the last change.
+	(nnimap-parse-flags): Store HIGHESTMODSEQ as a string, since it may be
+	too large for 32-bit Emacsen.
 
 2011-03-15  Nelson Ferreira  <[email protected]>  (tiny change)
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 1a2bb6f..8184d68 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1452,8 +1452,8 @@ textual parts.")
   ;; Change \Delete etc to %Delete, so that the reader can read it.
   (subst-char-in-region (point-min) (point-max)
 			?\\ ?% t)
-  ;; Remove any MODSEQ entries in the buffer, because they may
-  ;; contain numbers that are too large for 32-bit Emacsen.
+  ;; Remove any MODSEQ entries in the buffer, because they may contain
+  ;; numbers that are too large for 32-bit Emacsen.
   (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
     (replace-match "" t t))
   (goto-char (point-min))
@@ -1496,9 +1496,9 @@ textual parts.")
 			    (match-string 1)))
 		 (goto-char start)
 		 (setq highestmodseq
-		       (and (search-forward "HIGHESTMODSEQ "
+		       (and (re-search-forward "HIGHESTMODSEQ \\([0-9]+\\)"
 					    (or end (point-min)) t)
-			    (read (current-buffer))))
+			    (match-string 1)))
 		 (goto-char end)
 		 (forward-line -1))
 	       ;; The UID FETCH FLAGS was successful.

commit 704c61d7d20e685228107477c22d2ffa84d12eed
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Mar 15 17:57:10 2011 +0100

    (nnimap-parse-flags): Simplify the last change.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d27e98c..dd1ec97 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -2,6 +2,7 @@
 
 	* nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
 	parsing to avoid integer overflows.
+	(nnimap-parse-flags): Simplify the last change.
 
 2011-03-15  Nelson Ferreira  <[email protected]>  (tiny change)
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 36d8c95..1a2bb6f 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1452,6 +1452,11 @@ textual parts.")
   ;; Change \Delete etc to %Delete, so that the reader can read it.
   (subst-char-in-region (point-min) (point-max)
 			?\\ ?% t)
+  ;; Remove any MODSEQ entries in the buffer, because they may
+  ;; contain numbers that are too large for 32-bit Emacsen.
+  (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
+    (replace-match "" t t))
+  (goto-char (point-min))
   (let (start end articles groups uidnext elems permanent-flags
 	      uidvalidity vanished highestmodseq)
     (dolist (elem sequences)
@@ -1505,11 +1510,6 @@ textual parts.")
 		(setq start end))
 	    (setq start (point))
 	    (goto-char end))
-	  ;; Remove any MODSEQ entries in the buffer, because they may
-	  ;; contain numbers that are too large for 32-bit Emacsen.
-	  (save-excursion
-	    (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
-	      (replace-match "" t t)))
 	  (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
 	    (let ((p (point)))
 	      (setq elems (read (current-buffer)))

commit d74efc755ffa6170bac7b763e0c4829e2142b3e6
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Tue Mar 15 17:52:42 2011 +0100

    Remove all MODSEQ entries before parsing to avoid integer overflows.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8908666..d27e98c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-15  Lars Magne Ingebrigtsen  <[email protected]>
+
+	* nnimap.el (nnimap-parse-flags): Remove all MODSEQ entries before
+	parsing to avoid integer overflows.
+
 2011-03-15  Nelson Ferreira  <[email protected]>  (tiny change)
 
 	* gnus-art.el (gnus-article-treat-body-boundary): Fix boundary width on
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 11c521f..36d8c95 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -1505,20 +1505,14 @@ textual parts.")
 		(setq start end))
 	    (setq start (point))
 	    (goto-char end))
+	  ;; Remove any MODSEQ entries in the buffer, because they may
+	  ;; contain numbers that are too large for 32-bit Emacsen.
+	  (save-excursion
+	    (while (re-search-forward " MODSEQ ([0-9]+)" nil t)
+	      (replace-match "" t t)))
 	  (while (re-search-forward "^\\* [0-9]+ FETCH " start t)
 	    (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)))))
+	      (setq elems (read (current-buffer)))
 	      (push (cons (cadr (memq 'UID elems))
 			  (cadr (memq 'FLAGS elems)))
 		    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   |   11 +++++++++++
 lisp/gnus-win.el |    6 ++++--
 lisp/nnimap.el   |   22 ++++++++--------------
 3 files changed, 23 insertions(+), 16 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.