diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-09 16:50:39 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-09 16:50:39 +0000 |
commit | 28a3dae8080985b4d6a9cb22d997b7f71c214051 (patch) | |
tree | 02f420dcc6c66ddd867066088e5fee0d2b7befa4 /file.c | |
parent | 5e45af463cca6f062a986d5e686350e17ea653bb (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.c | 9 |
1 files changed, 1 insertions, 8 deletions
@@ -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); |