summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 16:46:28 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-06-10 16:46:28 +0000
commitfce17c541a36d5e7b91fe7afb26b63f7ea6e232a (patch)
treef0452e63b9671418067795d525bcd21e1619cfc3
parent32e3478725e1fde80e8f97ad95550120ece251a0 (diff)
merges r28105 from trunk into ruby_1_9_2.
-- * file.c (file_expand_path): Refix r28102: this breaks r28039. test for [ruby-dev:41429] is added. [ruby-core:30516] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--file.c5
-rw-r--r--test/ruby/test_path.rb2
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b2ebd550ef..1c16e9ef44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon May 31 15:07:18 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * file.c (file_expand_path): Refix r28102: this breaks
+ r28039. test for [ruby-dev:41429] is added. [ruby-core:30516]
+
Mon May 31 02:17:54 2010 Yukihiro Matsumoto <matz@ruby-lang.org>
* insns.def (defined): respond_to_missing? may not be available
diff --git a/file.c b/file.c
index 1d9ad50840..7bb4e0bdc5 100644
--- a/file.c
+++ b/file.c
@@ -2887,7 +2887,8 @@ 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_check(result, fname);
+ else
+ rb_enc_associate(result, rb_enc_check(result, fname));
p = chompdirsep(skiproot(buf));
s += 2;
}
@@ -2897,7 +2898,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_check(result, fname);
+ rb_enc_associate(result, rb_enc_check(result, fname));
}
else {
char *dir = my_getcwd();
diff --git a/test/ruby/test_path.rb b/test/ruby/test_path.rb
index 477bb7a287..ad080fa444 100644
--- a/test/ruby/test_path.rb
+++ b/test/ruby/test_path.rb
@@ -42,6 +42,8 @@ class TestPath < Test::Unit::TestCase
end
assert_equal("//", File.expand_path(".", "//"))
assert_equal("//sub", File.expand_path("sub", "//"))
+
+ assert_equal("/tmp/\u3042", File.expand_path("\u3042", "/tmp"))
end
def test_dirname