diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-30 05:27:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-30 05:27:21 +0000 |
commit | 5dc51d821ef76c610d64464d511c34bf6b67e74a (patch) | |
tree | 838ddbd6dec77372d16eea450c350c1e738634cc /win32/file.c | |
parent | efbfd9027282e6f82f41edd32a1732d4a07e90a3 (diff) |
file.c: include terminator
* win32/file.c (rb_readlink): include the terminator, since
rb_w32_mbstr_to_wstr appends a terminator only when the length
is not given explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/file.c')
-rw-r--r-- | win32/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/file.c b/win32/file.c index 0f5b285ff8..6452aadaba 100644 --- a/win32/file.c +++ b/win32/file.c @@ -671,7 +671,8 @@ rb_readlink(VALUE path) path = fix_string_encoding(path, enc); cp = CP_UTF8; } - wpath = mbstr_to_wstr(cp, RSTRING_PTR(path), RSTRING_LEN(path), NULL); + wpath = mbstr_to_wstr(cp, RSTRING_PTR(path), + RSTRING_LEN(path)+rb_enc_mbminlen(enc), NULL); if (!wpath) rb_memerror(); len = rb_w32_wreadlink(wpath, wbuf, numberof(wbuf)); free(wpath); |