summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 04:23:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-05 04:23:05 +0000
commite3b9ed7649a62d37fce1f588cd84802c93331520 (patch)
tree5e25c4e1ed9313356d5dda1c002106887be1d108
parent7cd3fcfbaa8efabe756f52ef36c91469be525d5d (diff)
curses.c: fix function
* ext/curses/curses.c (Init_curses): fix implementation function, crmode should be same as cbreak. [ruby-core:54013] [Bug #8222] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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