зеркало из https://github.com/github/ruby.git
* encoding.c (enc_replicate): new encoding name must be valid
c-string. [ruby-dev:40954] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
021e7b7f20
Коммит
9f9ace81f8
|
@ -1,3 +1,8 @@
|
|||
Sun Apr 11 12:08:49 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (enc_replicate): new encoding name must be valid
|
||||
c-string. [ruby-dev:40954]
|
||||
|
||||
Sun Apr 11 11:58:23 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/win32.h (ftruncate): rename to get rid of conflict
|
||||
|
|
|
@ -326,7 +326,7 @@ static VALUE
|
|||
enc_replicate(VALUE encoding, VALUE name)
|
||||
{
|
||||
return rb_enc_from_encoding_index(
|
||||
rb_enc_replicate(RSTRING_PTR(name),
|
||||
rb_enc_replicate(StringValueCStr(name),
|
||||
rb_to_encoding(encoding)));
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,7 @@ class TestEncoding < Test::Unit::TestCase
|
|||
def test_replicate
|
||||
assert(Encoding::UTF_8.replicate('UTF-8-ANOTHER'))
|
||||
assert(Encoding::ISO_2022_JP.replicate('ISO-2022-JP-ANOTHER'))
|
||||
assert_raise(TypeError, bug3127 = '[ruby-dev:40954]') {Encoding::UTF_8.replicate(0)}
|
||||
end
|
||||
|
||||
def test_dummy_p
|
||||
|
|
Загрузка…
Ссылка в новой задаче