diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-16 02:27:07 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-10-16 02:27:07 +0000 |
commit | a583f4206210cfccd9228d6f1f0cef0f2fdb5b92 (patch) | |
tree | 3dce7af46eda64a3cbba90a43f76a4f26d21c5a8 /file.c | |
parent | 7b4f0c0d1d4815807b000506cb470eb925834f9d (diff) | |
download | ruby-a583f4206210cfccd9228d6f1f0cef0f2fdb5b92.tar.gz |
file.c: ASCII-compatible
* file.c (rb_file_join): check nul-byte only for strings, since
FilePathStringValue() does it. [ruby-core:48012] [Bug #7168]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3941,6 +3941,7 @@ rb_file_join(VALUE ary, VALUE sep) tmp = RARRAY_PTR(ary)[i]; switch (TYPE(tmp)) { case T_STRING: + StringValueCStr(tmp); break; case T_ARRAY: if (ary == tmp) { @@ -3957,8 +3958,7 @@ rb_file_join(VALUE ary, VALUE sep) default: FilePathStringValue(tmp); } - name = StringValueCStr(result); - len = RSTRING_LEN(result); + RSTRING_GETMEM(result, name, len); if (i == 0) { rb_enc_copy(result, tmp); } |