summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ext/curses/curses.c2
-rw-r--r--test/test_curses.rb6
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e34df736463..e809b065810 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 5 13:22:59 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@zacharyscott.net>
* ext/curses/hello.rb: Typo in Curses example by Drew Blas
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index 175e32cff95..88b1bdb3aa2 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -2715,7 +2715,7 @@ Init_curses(void)
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);
diff --git a/test/test_curses.rb b/test/test_curses.rb
index d59f7dd3540..9432c024bb5 100644
--- a/test/test_curses.rb
+++ b/test/test_curses.rb
@@ -51,4 +51,10 @@ src
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