From 9df79d8f0565f0e28d588e2da1c40bc0910b5e70 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 1 Jun 2020 10:11:21 -0700 Subject: don't try to insert a blank line if trailers are at top of message Signed-off-by: Sean Whitton --- mbox-extract-patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mbox-extract-patch b/mbox-extract-patch index 3b80fd1..31e6ceb 100755 --- a/mbox-extract-patch +++ b/mbox-extract-patch @@ -178,7 +178,7 @@ package Mail::Message { } } - $lines[$i - 1] =~ /^$/ or unshift @new_ts, "\n"; + $i == 0 or $lines[$i - 1] =~ /^$/ or unshift @new_ts, "\n"; splice @lines, $i, 0, @new_ts; my $body = Mail::Message::Body->new( -- cgit v1.2.3