summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-30 19:03:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-30 19:03:47 +0000
commitea046e22eda06e455c34ff5d4ec413d5538d6e38 (patch)
treea2d6b10e49976ac555e7576e0bfc2aa446319508
parent0cf9530af305b59e8a75e7654caccbb9e455894a (diff)
* 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/branches/ruby_1_9_2@28102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--file.c4
-rw-r--r--test/ruby/test_beginendblock.rb1
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 69a6fd09f3..b5edb347dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 01:28:58 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
* lib/delegate: Delegator: combine (public|protected) methods with
diff --git a/file.c b/file.c
index 56b467fa99..c86eb53f0c 100644
--- a/file.c
+++ b/file.c
@@ -2896,7 +2896,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;
}
@@ -2906,7 +2906,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