Remove the data that may have arrived before the FETCH data.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Sep 2010 19:00:03 +0000 (21:00 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Sep 2010 19:00:03 +0000 (21:00 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 45e0161..430bf59 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-get-whole-article): Remove the data that may have
+       arrived before the FETCH data.
+
        * nnmh.el (nnmh-request-expire-articles): Don't try to fetch the expiry
        target here, because we don't know the Gnus name of the group.
 
index 6c112fa..a99ee08 100644 (file)
@@ -421,10 +421,13 @@ some servers.")
          article)))
     ;; Check that we really got an article.
     (goto-char (point-min))
-    (unless (looking-at "\\* [0-9]+ FETCH")
+    (unless (re-search-forward "\\* [0-9]+ FETCH" nil t)
       (setq result nil))
     (when result
-      (goto-char (point-min))
+      ;; Remove any data that may have arrived before the FETCH data.
+      (beginning-of-line)
+      (unless (bobp)
+       (delete-region (point-min) (point)))
       (let ((bytes (nnimap-get-length)))
        (delete-region (line-beginning-position)
                       (progn (forward-line 1) (point)))