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
This commit is contained in:
parent
47f6196cf0
commit
ec943ac668
@ -1,3 +1,11 @@
|
|||||||
|
Fri Jan 29 17:40:07 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
Fri Jan 29 17:07:27 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jan 29 17:07:27 2016 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
|
* win32/win32.c (fileattr_to_unixmode, rb_w32_reparse_symlink_p): volume
|
||||||
|
@ -697,6 +697,7 @@ rb_readlink(VALUE path, rb_encoding *resultenc)
|
|||||||
enc = resultenc;
|
enc = resultenc;
|
||||||
cp = path_cp = code_page(enc);
|
cp = path_cp = code_page(enc);
|
||||||
if (cp == INVALID_CODE_PAGE) cp = CP_UTF8;
|
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);
|
str = append_wstr(rb_enc_str_new(0, 0, enc), wbuf, len, cp, path_cp, enc);
|
||||||
ALLOCV_END(wtmp);
|
ALLOCV_END(wtmp);
|
||||||
return str;
|
return str;
|
||||||
|
@ -4888,6 +4888,7 @@ w32_readlink(UINT cp, const char *path, char *buf, size_t bufsize)
|
|||||||
errno = map_errno(e);
|
errno = map_errno(e);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
len = lstrlenW(wname) + 1;
|
||||||
ret = WideCharToMultiByte(cp, 0, wname, len, buf, bufsize, NULL, NULL);
|
ret = WideCharToMultiByte(cp, 0, wname, len, buf, bufsize, NULL, NULL);
|
||||||
ALLOCV_END(wtmp);
|
ALLOCV_END(wtmp);
|
||||||
if (e) {
|
if (e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user