зеркало из https://github.com/github/ruby.git
* file.c (w32_io_info): get rid of too huge alloca().
[Bug #4313] [ruby-core:34830] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
21931d6aa2
Коммит
18c11392af
|
@ -1,3 +1,8 @@
|
|||
Thu Jan 27 18:34:58 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* file.c (w32_io_info): get rid of too huge alloca().
|
||||
[Bug #4313] [ruby-core:34830]
|
||||
|
||||
Thu Jan 27 18:19:51 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* win32/win32.c (wstati64): get rid of too huge alloca().
|
||||
|
|
5
file.c
5
file.c
|
@ -835,15 +835,18 @@ w32_io_info(VALUE *file, BY_HANDLE_FILE_INFORMATION *st)
|
|||
VALUE tmp;
|
||||
WCHAR *ptr;
|
||||
int len;
|
||||
VALUE v;
|
||||
|
||||
FilePathValue(*file);
|
||||
tmp = rb_str_encode_ospath(*file);
|
||||
len = MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, NULL, 0);
|
||||
ptr = ALLOCA_N(WCHAR, len);
|
||||
ptr = ALLOCV_N(WCHAR, v, len);
|
||||
MultiByteToWideChar(CP_UTF8, 0, RSTRING_PTR(tmp), -1, ptr, len);
|
||||
f = CreateFileW(ptr, 0,
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
|
||||
rb_w32_iswin95() ? 0 : FILE_FLAG_BACKUP_SEMANTICS,
|
||||
NULL);
|
||||
ALLOCV_END(v);
|
||||
if (f == INVALID_HANDLE_VALUE) return f;
|
||||
ret = f;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче