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

* 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
This commit is contained in:
nobu 2010-05-30 19:03:47 +00:00
parent e0ad353fe0
commit b5cd43c998
3 changed files with 11 additions and 2 deletions

View file

@ -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

4
file.c
View file

@ -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();

View file

@ -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