]> git.cworth.org Git - sup/commitdiff
warnings bugfix (thanks Magnus)
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 11 Sep 2007 23:27:41 +0000 (23:27 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Tue, 11 Sep 2007 23:27:41 +0000 (23:27 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@563 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/message.rb
lib/sup/textfield.rb

index 0bbc97eeeceba465dfda72dd6171e2f16fd66de0..744485a6aa7dfb08edf9eb48f101d66496ccc8da 100644 (file)
@@ -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
index 7fe020ccc355c888ce8bbf7d0354927a195175c5..8fafa2ac24aa5d17e1579db49c53494c045e31e9 100644 (file)
@@ -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