From 556c5593b496c369fb455102fde83c95472102c2 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Wed, 25 Aug 2021 16:16:38 -0400 Subject: Normalize linebreaks when reconstituting body When generating am-ready patch series, separate each standard body part with a single pair of newlines regardless of how many the original message contained. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index 54add04..e0a03db 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1552,7 +1552,7 @@ class LoreMessage: self.body += '\n' if len(message): - self.body += message + '\n' + self.body += message.rstrip('\r\n') + '\n' if len(fixtrailers): self.body += '\n' @@ -1563,12 +1563,10 @@ class LoreMessage: self.body += '%s\n' % trailer[2] if len(basement): self.body += '---\n' - self.body += basement - self.body += '\n' + self.body += basement.rstrip('\r\n') + '\n\n' if len(signature): self.body += '-- \n' - self.body += signature - self.body += '\n' + self.body += signature.rstrip('\r\n') + '\n\n' def get_am_subject(self, indicate_reroll=True): # Return a clean patch subject -- cgit v1.2.3