diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-08-25 16:16:38 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2021-08-25 16:16:38 -0400 |
commit | 556c5593b496c369fb455102fde83c95472102c2 (patch) | |
tree | c84104117a6e421e7596fe9e740f4c7a4fcbf345 | |
parent | 7192223d35cff1e5fab28dfc54a8b6a3b778bad4 (diff) | |
download | b4-556c5593b496c369fb455102fde83c95472102c2.tar.gz |
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 <konstantin@linuxfoundation.org>
-rw-r--r-- | b4/__init__.py | 8 |
1 files 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 |