From b601756d021e3d7a08a5670db6db520845979e26 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 4 Apr 1998 21:07:43 +0000 Subject: [PATCH] * eword-decode.el (eword-analyze-comment): Swallow series of comments and unterminated comment. --- ChangeLog | 5 +++++ eword-decode.el | 16 ++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4608544..704d13f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1998-04-04 Tanaka Akira + + * eword-decode.el (eword-analyze-comment): Swallow series of comments + and unterminated comment. + 1998-04-03 Tanaka Akira * eword-decode.el (eword-analyze-atom): Set enable-multibyte-characters diff --git a/eword-decode.el b/eword-decode.el index 9a953c0..543c2a0 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -630,12 +630,16 @@ be the result." (std11-analyze-domain-literal string)) (defun eword-analyze-comment (string &optional must-unfold) - (let ((p (std11-check-enclosure string ?\( ?\) t))) - (if p - (cons (cons 'comment - (eword-decode-comment-string (substring string 0 p))) - (substring string p)) - ))) + (let ((len (length string))) + (if (and (< 0 len) (eq (aref string 0) ?\()) + (let ((p 0)) + (while (and p (< p len) (eq (aref string p) ?\()) + (setq p (std11-check-enclosure string ?\( ?\) t p))) + (setq p (or p len)) + (cons (cons 'comment + (eword-decode-comment-string (substring string 0 p))) + (substring string p))) + nil))) (defun eword-analyze-spaces (string &optional must-unfold) (std11-analyze-spaces string)) -- 1.7.10.4