1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* file.c (append_fspath): need to set the encoding to result always.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2012-01-30 03:31:58 +00:00
parent 44666293ff
commit bfaba73ebb
2 changed files with 5 additions and 1 deletions

View file

@ -1,3 +1,7 @@
Mon Jan 30 12:31:05 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* file.c (append_fspath): need to set the encoding to result always.
Mon Jan 30 10:38:37 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/irb/test_completion.rb: skip if cannot load irb/completion

2
file.c
View file

@ -2888,7 +2888,6 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
RSTRING_GETMEM(dirname, cwdp, dirlen);
}
*enc = direnc;
rb_enc_associate(result, direnc);
}
do {buflen *= 2;} while (dirlen > buflen);
rb_str_resize(result, buflen);
@ -2896,6 +2895,7 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
memcpy(buf, cwdp, dirlen);
xfree(dir);
if (!NIL_P(dirname)) rb_str_resize(dirname, 0);
rb_enc_associate(result, *enc);
return buf + dirlen;
}