(nnimap-wait-for-response): Wait for results in a more secure manner.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 31 Jan 2011 04:33:40 +0000 (20:33 -0800)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Mon, 31 Jan 2011 04:33:40 +0000 (20:33 -0800)
lisp/ChangeLog
lisp/nnimap.el

index aea00e8..c029694 100644 (file)
@@ -1,5 +1,8 @@
 2011-01-31  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-wait-for-response): Wait for results in a more
+       secure manner.
+
        * gnus-art.el (article-update-date-lapsed): Try to avoid having point
        move around by not using save-window-excursion.  It seems to work...
 
index 04e4bd6..005f60b 100644 (file)
@@ -1589,17 +1589,14 @@ textual parts.")
          (goto-char (point-max))
          (while (and (setq openp (memq (process-status process)
                                        '(open run)))
-                     (not (re-search-backward
-                           (format "^%d .*\n" sequence)
-                           (if nnimap-streaming
-                               (max (point-min)
-                                    (min
-                                     (- (point) 500)
-                                     (save-excursion
-                                       (forward-line -3)
-                                       (point))))
-                             (point-min))
-                           t)))
+                     (progn
+                       ;; Skip past any "*" lines that the server has
+                       ;; output.
+                       (while (and (not (bobp))
+                                   (progn
+                                     (forward-line -1)
+                                     (looking-at "\\*"))))
+                       (not (looking-at (format "%d " sequence)))))
            (when messagep
              (nnheader-message 7 "nnimap read %dk" (/ (buffer-size) 1000)))
            (nnheader-accept-process-output process)