summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-13 14:50:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-13 14:50:26 +0000
commitdc6075844d95c40001a0ec6ef4f8af19c0da58d9 (patch)
tree5682c2ca6691284b38b1719464405eb7124f074b /file.c
parent0e9620fd38d9bad8f0857e2ac031bf7b9f50a72d (diff)
* file.c (file_expand_path): should not just copy the encoding
from fname. [ruby-core:28635] * file.c (EXPAND_PATH_BUFFER): set filesystem_encoding, not usascii for path buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26909 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 aed663ac11..0874732389 100644
--- a/file.c
+++ b/file.c
@@ -2831,7 +2831,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
p = buf + (s - b);
BUFCHECK(bdiff >= buflen);
memset(buf, '/', p - buf);
- rb_enc_copy(result, fname);
+ rb_enc_associate(result, rb_enc_check(result, fname));
}
if (p > buf && p[-1] == '/')
--p;
@@ -2998,7 +2998,7 @@ file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
return result;
}
-#define EXPAND_PATH_BUFFER() rb_usascii_str_new(0, MAXPATHLEN + 2)
+#define EXPAND_PATH_BUFFER() rb_filesystem_str_new(0, MAXPATHLEN + 2)
#define check_expand_path_args(fname, dname) \
((fname = rb_get_path(fname)), \