From 8c3b13e52d8446d1d6cecfc6974a057d93161a77 Mon Sep 17 00:00:00 2001 From: Xinglu Chen Date: Tue, 16 Feb 2021 12:23:17 +0100 Subject: Make regexp stricter for matching signed messages This should fix the problem seen in <87sg5wxo0q.fsf@protesilaos.com> * git-email.el (git-email--compose-email): Match the beginning and end of line. Reported-by: Protesilaos Stavrou Signed-off-by: Xinglu Chen --- git-email.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-email.el b/git-email.el index 6276181..3db1ca3 100644 --- a/git-email.el +++ b/git-email.el @@ -320,7 +320,7 @@ them into the message buffer." ;; Insert diff at the beginning of the body (goto-char (point-min)) (let ((body (or (re-search-forward - "<#part \\(encrypt\\|sign\\)=.*mime>" + "^<#part \\(encrypt\\|sign\\)=.*mime>$" nil t) (re-search-forward (regexp-quote mail-header-separator) nil t)))) (save-excursion -- cgit v1.2.3