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:
parent
e0ad353fe0
commit
b5cd43c998
3 changed files with 11 additions and 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>
|
Mon May 31 02:17:54 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* insns.def (defined): respond_to_missing? may not be available
|
* insns.def (defined): respond_to_missing? may not be available
|
||||||
|
|
4
file.c
4
file.c
|
@ -2887,7 +2887,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
||||||
xfree(dir);
|
xfree(dir);
|
||||||
rb_enc_associate_index(result, rb_filesystem_encindex());
|
rb_enc_associate_index(result, rb_filesystem_encindex());
|
||||||
}
|
}
|
||||||
else rb_enc_copy(result, fname);
|
else rb_enc_check(result, fname);
|
||||||
p = chompdirsep(skiproot(buf));
|
p = chompdirsep(skiproot(buf));
|
||||||
s += 2;
|
s += 2;
|
||||||
}
|
}
|
||||||
|
@ -2897,7 +2897,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
|
||||||
if (!NIL_P(dname)) {
|
if (!NIL_P(dname)) {
|
||||||
file_expand_path(dname, Qnil, abs_mode, result);
|
file_expand_path(dname, Qnil, abs_mode, result);
|
||||||
BUFINIT();
|
BUFINIT();
|
||||||
rb_enc_copy(result, fname);
|
rb_enc_check(result, fname);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
char *dir = my_getcwd();
|
char *dir = my_getcwd();
|
||||||
|
|
|
@ -55,6 +55,7 @@ class TestBeginEndBlock < Test::Unit::TestCase
|
||||||
errout = Tempfile.new(self.class.name)
|
errout = Tempfile.new(self.class.name)
|
||||||
|
|
||||||
launcher << <<EOF
|
launcher << <<EOF
|
||||||
|
# -*- coding: #{ruby.encoding.name} -*-
|
||||||
errout = ARGV.shift
|
errout = ARGV.shift
|
||||||
STDERR.reopen(File.open(errout, "w"))
|
STDERR.reopen(File.open(errout, "w"))
|
||||||
STDERR.sync = true
|
STDERR.sync = true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue