sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 464b1aeb0148fd15751e1103434a8f96628fe98c
parent 76177784f453c6bdd544ec3974dcee8b5779cd8a
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Tue, 11 Sep 2007 23:27:41 +0000

warnings bugfix (thanks Magnus)

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

Diffstat:
M lib/sup/message.rb | 19 +++++++++++--------
M lib/sup/textfield.rb | 1 +
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -53,15 +53,18 @@ EOS
       @content_type = content_type
       @filename = filename
       @raw_content = encoded_content.decode
-      charset = encoded_content.charset
 
-      if @content_type =~ /^text\/plain\b/
-        @lines = Message.convert_from(@raw_content, charset).split("\n")
-      else
-        text = HookManager.run "mime-decode", :content_type => content_type,
-          :filename => lambda { write_to_disk }, :sibling_types => sibling_types
-        @lines = text.split("\n") if text
-      end
+      @lines = 
+        case @content_type
+        when /^text\/plain\b/
+          Message.convert_from(@raw_content, encoded_content.charset).split("\n")
+        else
+          text = HookManager.run "mime-decode", :content_type => content_type,
+                                 :filename => lambda { write_to_disk },
+                                 :sibling_types => sibling_types
+          text.split("\n") if text
+          
+        end
     end
 
     def inlineable?; !@lines.nil? end
diff --git a/lib/sup/textfield.rb b/lib/sup/textfield.rb
@@ -39,6 +39,7 @@ class TextField
     @field = Ncurses::Form.new_field 1, @width - question.length,
                                      @y, @x + question.length, 0, 0
     @form = Ncurses::Form.new_form [@field]
+    @value = nil
     Ncurses::Form.post_form @form
     set_cursed_value default if default
   end