From c770a0427dfd725c1227cde021b0d6fa9c795300 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 1 Jun 2020 08:17:37 -0700 Subject: mbox-extract-patch: ensure a blank line before block of trailers Signed-off-by: Sean Whitton --- debian/changelog | 2 ++ mbox-extract-patch | 2 ++ 2 files changed, 4 insertions(+) diff --git a/debian/changelog b/debian/changelog index 6af78cf..2f1d317 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ mailscripts (0.21-1) UNRELEASED; urgency=medium rather than passing the search query directly to `notmuch-show'. That is not how `notmuch-show' is meant to be called and can result in strange behaviour. + * mbox-extract-patch: When inserting trailers, ensure there is a blank + line before the block of trailers. * Add a Homepage: to the Debian packaging metadata (Closes: #961664). Thanks to Daniel Kahn Gillmor for the patch. diff --git a/mbox-extract-patch b/mbox-extract-patch index 276895b..3b80fd1 100755 --- a/mbox-extract-patch +++ b/mbox-extract-patch @@ -178,6 +178,8 @@ package Mail::Message { } } + $lines[$i - 1] =~ /^$/ or unshift @new_ts, "\n"; + splice @lines, $i, 0, @new_ts; my $body = Mail::Message::Body->new( charset => "PERL", -- cgit v1.2.3