summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-09 16:50:39 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-09 16:50:39 +0000
commit28a3dae8080985b4d6a9cb22d997b7f71c214051 (patch)
tree02f420dcc6c66ddd867066088e5fee0d2b7befa4 /file.c
parent5e45af463cca6f062a986d5e686350e17ea653bb (diff)
* file.c (append_fspath): no need to do encoding trick here.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'file.c')
-rw-r--r--file.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/file.c b/file.c
index 386a8fbe47..c1db6d70f8 100644
--- a/file.c
+++ b/file.c
@@ -2874,14 +2874,7 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
VALUE dirname = Qnil;
size_t dirlen = strlen(dir), buflen = rb_str_capacity(result);
- if (*enc != fsenc) {
- rb_encoding *direnc = rb_enc_check(fname, dirname = rb_enc_str_new(dir, dirlen, fsenc));
- if (direnc != fsenc) {
- dirname = rb_str_conv_enc(dirname, fsenc, direnc);
- RSTRING_GETMEM(dirname, cwdp, dirlen);
- }
- *enc = direnc;
- }
+ *enc = fsenc;
do {buflen *= 2;} while (dirlen > buflen);
rb_str_resize(result, buflen);
buf = RSTRING_PTR(result);