From 8943cf1ad32a11652fe72ef4d34025f9618176ec Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 30 Jan 2011 20:33:40 -0800 Subject: [PATCH] (nnimap-wait-for-response): Wait for results in a more secure manner. --- lisp/ChangeLog | 3 +++ lisp/nnimap.el | 19 ++++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aea00e817..c02969448 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-01-31 Lars Ingebrigtsen + * 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... diff --git a/lisp/nnimap.el b/lisp/nnimap.el index 04e4bd6c9..005f60b5c 100644 --- a/lisp/nnimap.el +++ b/lisp/nnimap.el @@ -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) -- 2.11.4.GIT