sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit eab3b63f9e555d0f322d9ab459a679bb9db7aea4
parent e7cbc872e7cdde1b4eed0731d254d829d6b1fee2
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed,  3 Jan 2007 13:31:45 +0000

minor bugfixes


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

Diffstat:
M lib/sup/buffer.rb | 12 ++++++------
M lib/sup/imap.rb | 2 +-
M lib/sup/mbox/ssh-file.rb | 2 +-
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -374,18 +374,18 @@ class BufferManager
   end
   
   def draw_minibuf opts={}
+    m = nil
     @minibuf_mutex.synchronize do
       m = @minibuf_stack.compact
       m << @flash if @flash
       m << "" if m.empty?
-
-      Ncurses.mutex.lock unless opts[:sync] == false
-      Ncurses.attrset Colormap.color_for(:none)
-      m.each_with_index do |s, i|
-        Ncurses.mvaddstr Ncurses.rows - i - 1, 0, s + (" " * [Ncurses.cols - s.length, 0].max)
-      end
     end
 
+    Ncurses.mutex.lock unless opts[:sync] == false
+    Ncurses.attrset Colormap.color_for(:none)
+    m.each_with_index do |s, i|
+      Ncurses.mvaddstr Ncurses.rows - i - 1, 0, s + (" " * [Ncurses.cols - s.length, 0].max)
+    end
     Ncurses.refresh if opts[:refresh]
     Ncurses.mutex.unlock unless opts[:sync] == false
   end
diff --git a/lib/sup/imap.rb b/lib/sup/imap.rb
@@ -124,7 +124,7 @@ class IMAP < Source
   def port; @parsed_uri.port || (ssl? ? 993 : 143); end
   def mailbox
     x = @parsed_uri.path[1..-1]
-    x.empty? ? 'INBOX' : x
+    x.nil? || x.empty? ? 'INBOX' : x
   end
   def ssl?; @parsed_uri.scheme == 'imaps' end
 
diff --git a/lib/sup/mbox/ssh-file.rb b/lib/sup/mbox/ssh-file.rb
@@ -171,7 +171,7 @@ private
     begin
       retries = 0
       connect
-      MBox::debug "sending command: #{cmd.inspect}"
+      # MBox::debug "sending command: #{cmd.inspect}"
       begin
         result = @shell.send_command cmd
         raise SSHFileError, "Failure during remote command #{cmd.inspect}: #{(result.stderr || result.stdout || "")[0 .. 100]}" unless result.status == 0