[sup-talk] [PATCH] Fix a bug about forwarding that trimmed out newlines.

Nicolas Pouillard nicolas.pouillard at gmail.com
Wed Apr 23 04:59:24 EDT 2008


Excerpts from William Morgan's message of Wed Apr 23 03:44:26 +0200 2008:
> Reformatted excerpts from nicolas.pouillard's message of 2008-04-21:
> > What about this patch?
> 
> I merged a more minor version of the fix into next.

Great!

However this hunk is useless:

====================================================================================
--- a/lib/sup/modes/edit-message-mode.rb
+++ b/lib/sup/modes/edit-message-mode.rb
@@ -122,7 +122,7 @@ EOS
     @file = Tempfile.new "sup.#{self.class.name.gsub(/.*::/, '').camel_to_hyphy}"
     @file.puts format_headers(@header - NON_EDITABLE_HEADERS).first
     @file.puts
-    @file.puts @body
+    @file.puts @body.join("\n")
     @file.close
 
     editor = $config[:editor] || ENV['EDITOR'] || "/usr/bin/vi"
====================================================================================

Since  puts of an array have the same semantics, but cheaper. However it worth
a comment to make it crystal clear.

-- 
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080423/d3ac93fb/attachment.bin 


More information about the sup-talk mailing list