diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-30 19:03:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-05-30 19:03:47 +0000 |
commit | b5cd43c998038156ecf5fc28e5138b7f88b9aafe (patch) | |
tree | aee22029a6b5c60fd7f0cdddf75cd42f4f1dedec | |
parent | e0ad353fe0419b642fd1f6070e8527b61cb0e4ed (diff) | |
download | ruby-b5cd43c998038156ecf5fc28e5138b7f88b9aafe.tar.gz |
* file.c (file_expand_path): check if expanded dname encoding is
compatible with fname, not just copying. [ruby-core:30516]
* test/ruby/test_beginendblock.rb (test_endblockwarn): needs
encoding comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | file.c | 4 | ||||
-rw-r--r-- | test/ruby/test_beginendblock.rb | 1 |
3 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,11 @@ +Mon May 31 04:03:43 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * file.c (file_expand_path): check if expanded dname encoding is + compatible with fname, not just copying. [ruby-core:30516] + + * test/ruby/test_beginendblock.rb (test_endblockwarn): needs + encoding comment. + Mon May 31 02:17:54 2010 Yukihiro Matsumoto <matz@ruby-lang.org> * insns.def (defined): respond_to_missing? may not be available @@ -2887,7 +2887,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result) xfree(dir); rb_enc_associate_index(result, rb_filesystem_encindex()); } - else rb_enc_copy(result, fname); + else rb_enc_check(result, fname); p = chompdirsep(skiproot(buf)); s += 2; } @@ -2897,7 +2897,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result) if (!NIL_P(dname)) { file_expand_path(dname, Qnil, abs_mode, result); BUFINIT(); - rb_enc_copy(result, fname); + rb_enc_check(result, fname); } else { char *dir = my_getcwd(); diff --git a/test/ruby/test_beginendblock.rb b/test/ruby/test_beginendblock.rb index 2ddcddd43b..dd72ac8101 100644 --- a/test/ruby/test_beginendblock.rb +++ b/test/ruby/test_beginendblock.rb @@ -55,6 +55,7 @@ class TestBeginEndBlock < Test::Unit::TestCase errout = Tempfile.new(self.class.name) launcher << <<EOF +# -*- coding: #{ruby.encoding.name} -*- errout = ARGV.shift STDERR.reopen(File.open(errout, "w")) STDERR.sync = true |