From 2374477d8a9f3aac2ac29f51c10e5d16686b33c3 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sat, 11 Jan 2003 19:34:20 +0000 Subject: [PATCH] (message-check-news-header-syntax): Compute the header length correctly. --- lisp/ChangeLog | 5 +++++ lisp/gnus-fun.el | 13 +++++++++---- lisp/message.el | 12 ++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index efdaa6eb0..3060c13ec 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2003-01-11 Lars Magne Ingebrigtsen + + * message.el (message-check-news-header-syntax): Compute the + header length correctly. + 2002-01-10 Kevin Greiner * gnus-agent.el (gnus-agent-expire): Do not remove article from diff --git a/lisp/gnus-fun.el b/lisp/gnus-fun.el index 08b60e66d..aa711da04 100644 --- a/lisp/gnus-fun.el +++ b/lisp/gnus-fun.el @@ -85,6 +85,7 @@ Output to the current buffer, replace text, and don't mingle error." (when (file-exists-p file) (let ((done nil) (attempt "") + (step 72) (quant 16)) (while (and (not done) (> quant 1)) @@ -104,10 +105,14 @@ Output to the current buffer, replace text, and don't mingle error." (insert attempt) (base64-encode-region (point-min) (point-max)) (goto-char (point-min)) - (forward-line 1) - (while (not (eobp)) - (insert " ") - (forward-line 1)) + (while (search-forward "\n" nil t) + (replace-match "")) + (goto-char (point-min)) + (while (> (- (point-max) (point)) + step) + (forward-char step) + (insert "\n ") + (setq step 76)) (buffer-string)) nil)))) diff --git a/lisp/message.el b/lisp/message.el index d791b1319..cb0e6f2eb 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -3779,16 +3779,20 @@ Otherwise, generate and save a value for `canlock-password' first." ;; Check long header lines. (message-check 'long-header-lines (let ((start (point)) + (header nil) + (length 0) found) (while (and (not found) (re-search-forward "^\\([^ \t:]+\\): " nil t)) - (when (> (- (point) start) 998) - (setq found t)) + (if (> (- (point) (match-beginning 0)) 998) + (setq found t + length (- (point) (match-beginning 0))) + (setq header (match-string-no-properties 1))) (setq start (match-beginning 0)) (forward-line 1)) (if found - (y-or-n-p (format "Your %s header is too long. Really post? " - (match-string 1))) + (y-or-n-p (format "Your %s header is too long (%d). Really post? " + header length)) t))) ;; Check for multiple identical headers. (message-check 'multiple-headers -- 2.25.1