mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/readline/readline.c (readline_s_get_line_buffer):
Readline.line_buffer should return locale string. [ruby-dev:42184] #3791 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a69423beb8
commit
59f551635a
3 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Mon Sep 6 10:31:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* ext/readline/readline.c (readline_s_get_line_buffer):
|
||||
Readline.line_buffer should return locale string.
|
||||
[ruby-dev:42184] #3791
|
||||
|
||||
Mon Sep 6 09:47:24 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||
|
||||
* util.c (ruby_strtod): check there is at least 1 digit after
|
||||
|
|
|
@ -426,7 +426,7 @@ readline_s_get_line_buffer(VALUE self)
|
|||
rb_secure(4);
|
||||
if (rl_line_buffer == NULL)
|
||||
return Qnil;
|
||||
return rb_tainted_str_new2(rl_line_buffer);
|
||||
return rb_locale_str_new_cstr(rl_line_buffer);
|
||||
}
|
||||
#else
|
||||
#define readline_s_get_line_buffer rb_f_notimplement
|
||||
|
|
|
@ -153,6 +153,8 @@ class TestReadline < Test::Unit::TestCase
|
|||
assert_equal("first second", actual_line_buffer)
|
||||
assert_equal(12, actual_point)
|
||||
assert_equal("first complete finish", Readline.line_buffer)
|
||||
assert_equal(Encoding.find("locale"), Readline.line_buffer.encoding)
|
||||
assert_equal(true, Readline.line_buffer.tainted?)
|
||||
assert_equal(21, Readline.point)
|
||||
ensure
|
||||
stdin.close(true)
|
||||
|
|
Loading…
Reference in a new issue