ruby-changes:28066
From: nobu <ko1@a...>
Date: Fri, 5 Apr 2013 13:23:21 +0900 (JST)
Subject: [ruby-changes:28066] nobu:r40118 (trunk): curses.c: fix function
nobu 2013-04-05 13:23:05 +0900 (Fri, 05 Apr 2013) New Revision: 40118 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40118 Log: curses.c: fix function * ext/curses/curses.c (Init_curses): fix implementation function, crmode should be same as cbreak. [ruby-core:54013] [Bug #8222] Modified files: trunk/ChangeLog trunk/ext/curses/curses.c trunk/test/test_curses.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 40117) +++ ChangeLog (revision 40118) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@r...> + + * ext/curses/curses.c (Init_curses): fix implementation function, + crmode should be same as cbreak. [ruby-core:54013] [Bug #8222] + Fri Apr 5 12:06:00 2013 Zachary Scott <zachary@z...> * ext/curses/hello.rb: Typo in Curses example by Drew Blas Index: ext/curses/curses.c =================================================================== --- ext/curses/curses.c (revision 40117) +++ ext/curses/curses.c (revision 40118) @@ -2715,7 +2715,7 @@ Init_curses(void) https://github.com/ruby/ruby/blob/trunk/ext/curses/curses.c#L2715 rb_define_module_function(mCurses, "noraw", curses_noraw, 0); rb_define_module_function(mCurses, "cbreak", curses_cbreak, 0); rb_define_module_function(mCurses, "nocbreak", curses_nocbreak, 0); - rb_define_module_function(mCurses, "crmode", curses_nocbreak, 0); + rb_define_module_function(mCurses, "crmode", curses_cbreak, 0); rb_define_module_function(mCurses, "nocrmode", curses_nocbreak, 0); rb_define_module_function(mCurses, "nl", curses_nl, 0); rb_define_module_function(mCurses, "nonl", curses_nonl, 0); Index: test/test_curses.rb =================================================================== --- test/test_curses.rb (revision 40117) +++ test/test_curses.rb (revision 40118) @@ -51,4 +51,10 @@ src https://github.com/ruby/ruby/blob/trunk/test/test_curses.rb#L51 def test_getch_nocbreak assert_raise(Timeout::Error) {run_curses("nocbreak; getch", "a")} end + def test_getch_crmode + assert_equal("a", run_curses("crmode; getch", "a")) + end + def test_getch_nocrmode + assert_raise(Timeout::Error) {run_curses("nocrmode; getch", "a")} + end end if defined? TestCurses and defined? PTY -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/