[gnus git] branch no-gnus updated: m0-1-34-g28e3cf8 =2= Allow nnimap to parse headers with spaces in odd places ; * nnimap.el (nnimap-transform-headers): Removed unused variable.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  28e3cf8574dca17746f5d87af36ed7ac116c8077 (commit)
       via  0d14b78eccd5c2c82a37ae0ffd1f36627ae03591 (commit)
      from  49b61d6c8abde0d76a28fefa380b2dc6eb7bd353 (commit)


- Log -----------------------------------------------------------------
commit 28e3cf8574dca17746f5d87af36ed7ac116c8077
Author: Lars Ingebrigtsen <[email protected]>
Date:   Tue Feb 7 03:32:39 2012 +0100

    Allow nnimap to parse headers with spaces in odd places
    
    (nnimap-transform-headers): Fix parsing BODYSTRUCTURE elements that
    have newlines within the strings, and where the UID comes after the
    BODYSTRUCTURE element (bug#10537).

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2ce4cae..26547d1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,8 +1,11 @@
 2012-02-07  Lars Ingebrigtsen  <[email protected]>
 
-	* nnimap.el (nnimap-transform-headers): Removed unused variable.
+	* nnimap.el (nnimap-transform-headers): Remove unused variable.
+	(nnimap-transform-headers): Fix parsing BODYSTRUCTURE elements that
+	have newlines within the strings, and where the UID comes after the
+	BODYSTRUCTURE element (bug#10537).
 
-	* shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix
+	* shr-color.el (shr-color-set-minimum-interval): Rename to add prefix
 	(bug#10732).
 
 	* shr.el (shr-insert-document): Add doc string.
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 57c81ad..c5b77db 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -192,21 +192,30 @@ textual parts.")
   (let (article lines size string)
     (block nil
       (while (not (eobp))
-	(while (not (looking-at "\\* [0-9]+ FETCH.+?UID \\([0-9]+\\)"))
+	(while (not (looking-at "\\* [0-9]+ FETCH"))
 	  (delete-region (point) (progn (forward-line 1) (point)))
 	  (when (eobp)
 	    (return)))
-	(setq article (match-string 1))
+	(goto-char (match-end 0))
 	;; Unfold quoted {number} strings.
-	(while (re-search-forward "[^]][ (]{\\([0-9]+\\)}\r?\n"
-				  (1+ (line-end-position)) t)
+	(while (re-search-forward
+		"[^]][ (]{\\([0-9]+\\)}\r?\n"
+		(save-excursion
+		  (or (re-search-forward "\\* [0-9]+ FETCH" nil t)
+		      (point-max)))
+		t)
 	  (setq size (string-to-number (match-string 1)))
 	  (delete-region (+ (match-beginning 0) 2) (point))
 	  (setq string (buffer-substring (point) (+ (point) size)))
 	  (delete-region (point) (+ (point) size))
-	  (insert (format "%S" string)))
-	(setq lines nil)
+	  (insert (format "%S" (subst-char-in-string
+				?\n ?\s string))))
 	(beginning-of-line)
+	(setq article
+	      (and (re-search-forward "UID \\([0-9]+\\)" (line-end-position)
+				      t)
+		   (match-string 1)))
+	(setq lines nil)
 	(setq size
 	      (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"
 				      (line-end-position)

commit 0d14b78eccd5c2c82a37ae0ffd1f36627ae03591
Author: Lars Ingebrigtsen <[email protected]>
Date:   Tue Feb 7 02:56:43 2012 +0100

    * nnimap.el (nnimap-transform-headers): Removed unused variable.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b9e05c0..2ce4cae 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
 2012-02-07  Lars Ingebrigtsen  <[email protected]>
 
+	* nnimap.el (nnimap-transform-headers): Removed unused variable.
+
 	* shr-color.el (shr-color-set-minimum-interval): Renamed to add prefix
 	(bug#10732).
 
diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 09cf554..57c81ad 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -189,7 +189,7 @@ textual parts.")
 
 (defun nnimap-transform-headers ()
   (goto-char (point-min))
-  (let (article bytes lines size string)
+  (let (article lines size string)
     (block nil
       (while (not (eobp))
 	(while (not (looking-at "\\* [0-9]+ FETCH.+?UID \\([0-9]+\\)"))
@@ -205,8 +205,7 @@ textual parts.")
 	  (setq string (buffer-substring (point) (+ (point) size)))
 	  (delete-region (point) (+ (point) size))
 	  (insert (format "%S" string)))
-	(setq bytes (nnimap-get-length)
-	      lines nil)
+	(setq lines nil)
 	(beginning-of-line)
 	(setq size
 	      (and (re-search-forward "RFC822.SIZE \\([0-9]+\\)"

-----------------------------------------------------------------------
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 |    7 ++++++-
 lisp/nnimap.el |   24 ++++++++++++++++--------
 2 files changed, 22 insertions(+), 9 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, no-gnus 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.