From fd135e2e5371af279117c05bf7b041971e7bc7c8 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 16 May 2005 21:04:20 +0000 Subject: [PATCH] (nntp-next-result-arrived-p): Some news servers may return \n.\n.\n at the end of articles. Protect against that. (nntp-with-open-group): Allow debugging. --- lisp/ChangeLog | 4 ++++ lisp/nntp.el | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d44b3ec9..b66b46ff7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2005-05-16 Lars Magne Ingebrigtsen + * nntp.el (nntp-next-result-arrived-p): Some news servers may + return \n.\n.\n at the end of articles. Protect against that. + (nntp-with-open-group): Allow debugging. + * nnheader.el (mail-header-set-extra): Make into a function because I just could't understand how to quote the list properly. diff --git a/lisp/nntp.el b/lisp/nntp.el index 993d2a609..d5f46ef94 100644 --- a/lisp/nntp.el +++ b/lisp/nntp.el @@ -561,7 +561,12 @@ be restored and the command retried." ;; a line with only a "." on it. ((eq (char-after) ?2) (if (re-search-forward "\n\\.\r?\n" nil t) - t + (progn + ;; Some broken news servers add another dot at the end. + ;; Protect against inflooping there. + (while (looking-at "^\\.\r?\n") + (forward-line 1)) + t) nil)) ;; A result that starts with a 3xx or 4xx code is terminated ;; by a newline. @@ -623,7 +628,8 @@ command whose response triggered the error." (condition-case nil (progn ,@forms) (quit - (nntp-close-server) + (unless debug-on-quit + (nntp-close-server)) (signal 'quit nil)))) (when timer (nnheader-cancel-timer timer))) -- 2.34.1