aboutsummaryrefslogtreecommitdiffstats
path: root/win32/win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-29 08:41:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-29 08:41:10 +0000
commit8fc991162a12670301b38174bb9062ed9f73ae33 (patch)
tree3780b069556ac0d6097bb884d4c93e6821b75b62 /win32/win32.c
parent41b566b62df50e33d3cef866c662b765812f7b21 (diff)
downloadruby-8fc991162a12670301b38174bb9062ed9f73ae33.tar.gz
win32/file.c: drop garbage
* win32/file.c (rb_readlink): drop garbage after the substitute name, as rb_w32_read_reparse_point returns the expected buffer size but "\??\" prefix is dropped from the result. * win32/win32.c (w32_readlink): ditto, including NUL-terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53689 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 35fe5a8557..47408e0375 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4888,6 +4888,7 @@ w32_readlink(UINT cp, const char *path, char *buf, size_t bufsize)
errno = map_errno(e);
return -1;
}
+ len = lstrlenW(wname) + 1;
ret = WideCharToMultiByte(cp, 0, wname, len, buf, bufsize, NULL, NULL);
ALLOCV_END(wtmp);
if (e) {