diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-29 08:41:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-01-29 08:41:10 +0000 |
commit | ec943ac6687461bae53501970212780bc3ec4f8b (patch) | |
tree | 3780b069556ac0d6097bb884d4c93e6821b75b62 /win32/file.c | |
parent | 47f6196cf023d466cafeb454e2188c7353b8397d (diff) |
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/file.c')
-rw-r--r-- | win32/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/win32/file.c b/win32/file.c index 85aea15d71..3b18a36348 100644 --- a/win32/file.c +++ b/win32/file.c @@ -697,6 +697,7 @@ rb_readlink(VALUE path, rb_encoding *resultenc) enc = resultenc; cp = path_cp = code_page(enc); if (cp == INVALID_CODE_PAGE) cp = CP_UTF8; + len = lstrlenW(wbuf); str = append_wstr(rb_enc_str_new(0, 0, enc), wbuf, len, cp, path_cp, enc); ALLOCV_END(wtmp); return str; |