]> git.cworth.org Git - sup/blobdiff - lib/sup/modes/edit-message-mode.rb
bugfix: gpg signing failures because when no trailing newlines
[sup] / lib / sup / modes / edit-message-mode.rb
index b2b60eb043290201b7aecbca6fa45cb4628a5012..7fdb4f1991c496dbd52a4c0eef92c785095b88e5 100644 (file)
@@ -305,8 +305,9 @@ protected
     m = RMail::Message.new
     m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
     m.body = @body.join
-    m.body = m.body
     m.body += sig_lines.join("\n") unless $config[:edit_signature]
+    ## body must end in a newline or GPG signatures will be WRONG!
+    m.body += "\n" unless m.body =~ /\n\Z/
 
     ## there are attachments, so wrap body in an attachment of its own
     unless @attachments.empty?