зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
efbfd90272
Коммит
5dc51d821e
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче