sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 396af5ad95a9307a456fa29b3bdd55b1bfef0660
parent e63279d0b1c1efcfba9ff489fe0b116291e6c874
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed,  3 Jan 2007 06:40:17 +0000

minor tweaks and bugfixes


git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@152 5c8cc53c-5e98-4d25-b20a-d8db53a31250

Diffstat:
M bin/sup-import | 1 -
M lib/sup/imap.rb | 7 +++++--
M lib/sup/mbox/ssh-file.rb | 3 +--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/bin/sup-import b/bin/sup-import
@@ -95,7 +95,6 @@ def get_login_info uri, sources
   [username, password]
 end
 
-
 educate_user if ARGV.member? '--help'
 
 archive = ARGV.delete "--archive"
diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb
@@ -48,7 +48,7 @@ class IMAP < Source
     @ids = []
     @labels = [:unread]
     @labels << :inbox unless archived?
-    @labels << mailbox.intern unless mailbox =~ /inbox/i || mailbox.nil?
+    @labels << mailbox.intern unless mailbox =~ /inbox/i
     @mutex = Mutex.new
   end
 
@@ -122,7 +122,10 @@ class IMAP < Source
 
   def host; @parsed_uri.host; end
   def port; @parsed_uri.port || (ssl? ? 993 : 143); end
-  def mailbox; @parsed_uri.path[1..-1] || 'INBOX'; end
+  def mailbox
+    x = @parsed_uri.path[1..-1]
+    x.empty? ? 'INBOX' : x
+  end
   def ssl?; @parsed_uri.scheme == 'imaps' end
 
   def load_header id
diff --git a/lib/sup/mbox/ssh-file.rb b/lib/sup/mbox/ssh-file.rb
@@ -171,10 +171,9 @@ private
     begin
       retries = 0
       connect
-      # MBox::debug "sending command: #{cmd.inspect}"
+      MBox::debug "sending command: #{cmd.inspect}"
       begin
         result = @shell.send_command cmd
-        result = @shell.sync { @shell.send_command cmd }
         raise SSHFileError, "Failure during remote command #{cmd.inspect}: #{(result.stderr || result.stdout || "")[0 .. 100]}" unless result.status == 0
       rescue Net::SSH::Exception # these happen occasionally for no apparent reason. gotta love that nondeterminism!
         retry if (retries += 1) <= 3