summaryrefslogtreecommitdiff
path: root/file.c
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 /file.c
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
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 2 insertions, 2 deletions
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();