1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* array.c (rb_ary_join): [].join.encoding must be US-ASCII.

[ruby-list:47790]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2011-01-29 15:33:50 +00:00
parent 1195ba6644
commit 674ea103fa
3 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Sat Jan 29 22:16:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
* array.c (rb_ary_join): [].join.encoding must be US-ASCII.
[ruby-list:47790]
Sat Jan 29 20:22:39 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* benchmark/driver.rb (BenchmarkDriver#measure): Show command line

View file

@ -1681,7 +1681,7 @@ rb_ary_join(VALUE ary, VALUE sep)
int untrust = FALSE;
VALUE val, tmp, result;
if (RARRAY_LEN(ary) == 0) return rb_str_new(0, 0);
if (RARRAY_LEN(ary) == 0) return rb_usascii_str_new(0, 0);
if (OBJ_TAINTED(ary) || OBJ_TAINTED(sep)) taint = TRUE;
if (OBJ_UNTRUSTED(ary) || OBJ_UNTRUSTED(sep)) untrust = TRUE;

View file

@ -890,6 +890,7 @@ class TestArray < Test::Unit::TestCase
a = @cls[]
assert_equal("", a.join)
assert_equal("", a.join(','))
assert_equal(Encoding::US_ASCII, a.join.encoding)
$, = ""
a = @cls[1, 2]