Edit Sup Issue: issue50

Summary
Issue type Status
Sup version Ruby version
Assigned To Tags (list)
Description
Attachments
  Make a copy

Created on 2010-01-25.16:18:41 by shenson, last changed by shenson.

Messages
msg121 (view) Author: shenson Date: 2010-01-26.03:08:31
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
index 14c1607..8cf5ee4 100644
--- a/lib/sup/buffer.rb
+++ b/lib/sup/buffer.rb
@@ -645,7 +645,7 @@ EOS
   ## returns true (y), false (n), or nil (ctrl-g / cancel)
   def ask_yes_or_no question
     case(r = ask_getch question, "ynYN")
-    when ?y.ord, ?Y.ord
+    when ?y, ?Y
       true
     when nil
       nil


The above patch fixes the bug.  I don't know how that affects ruby 1.9 though. 
Thanks.
msg120 (view) Author: shenson Date: 2010-01-25.16:18:40
[Mon Jan 25 11:06:26 -0500 2010] ERROR: oh crap, an exception
----------------------------------------------------------------
I'm very sorry. It seems that an error occurred in Sup. Please
accept my sincere apologies. Please submit the contents of
/home/shenson/.sup/exception-log.txt and a brief report of the
circumstances to http://masanjin.net/sup-bugs/ so that I might
address this problem. Thank you!

Sincerely,
William
----------------------------------------------------------------
--- NoMethodError from thread: main
undefined method `ord' for 121:Fixnum
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/buffer.rb:648:in `ask_yes_or_no'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/util.rb:553:in `send'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/util.rb:553:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/modes/thread-view-mode.rb:232:in
`bounce'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/mode.rb:51:in `send'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/mode.rb:51:in `handle_input'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/lib/sup/buffer.rb:270:in `handle_input'
/usr/lib/ruby/gems/1.8/gems/sup-0.10.1/bin/sup:270
/usr/bin/sup:19:in `load'
/usr/bin/sup:19

shenson@junkyard ~$ cat /etc/redhat-release 
Fedora release 12 (Constantine)
shenson@junkyard ~$ ruby --version
ruby 1.8.6 (2009-08-04 patchlevel 383) [x86_64-linux]

I was bouncing a message to another address and it caused the above error after
I hit 'y'.
History
Date User Action Args
2010-01-26 03:08:31shensonsetstatus: unread -> chatting
messages: + msg121
2010-01-25 16:18:41shensoncreate