sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 138a35a7d77fcf7cb35d5a67590d636a8eaaa185
parent 8c4842ac743d15004bdfffa91f652a4b3f54b835
Author: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Date:   Fri,  4 Apr 2008 18:00:56 +0200

use read instead of readlines.join

Diffstat:
M lib/sup/draft.rb | 2 +-
M lib/sup/hook.rb | 2 +-
M lib/sup/maildir.rb | 2 +-
M lib/sup/modes/file-browser-mode.rb | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/sup/draft.rb b/lib/sup/draft.rb
@@ -106,7 +106,7 @@ class DraftLoader < Source
   end
 
   def raw_message offset
-    IO.readlines(fn_for_offset(offset)).join
+    IO.read(fn_for_offset(offset))
   end
 
   def start_offset; 0; end
diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb
@@ -120,7 +120,7 @@ private
     unless @hooks.member? name
       @hooks[name] =
         begin
-          returning IO.readlines(fn_for(name)).join do
+          returning IO.read(fn_for(name)) do
             log "read '#{name}' from #{fn_for(name)}"
           end
         rescue SystemCallError => e
diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
@@ -72,7 +72,7 @@ class Maildir < Source
 
   def raw_message id
     scan_mailbox
-    with_file_for(id) { |f| f.readlines.join }
+    with_file_for(id) { |f| f.read }
   end
 
   def scan_mailbox opts={}
diff --git a/lib/sup/modes/file-browser-mode.rb b/lib/sup/modes/file-browser-mode.rb
@@ -47,7 +47,7 @@ protected
     return unless f && f.file?
 
     begin
-      BufferManager.spawn f.to_s, TextMode.new(f.readlines.join)
+      BufferManager.spawn f.to_s, TextMode.new(f.read)
     rescue SystemCallError => e
       BufferManager.flash e.message
     end