ruby-changes:52356
From: usa <ko1@a...>
Date: Mon, 27 Aug 2018 23:19:06 +0900 (JST)
Subject: [ruby-changes:52356] usa:r64564 (ruby_2_4): merge revision(s) 64092: [Backport #14942]
usa 2018-08-27 23:18:59 +0900 (Mon, 27 Aug 2018) New Revision: 64564 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64564 Log: merge revision(s) 64092: [Backport #14942] win32.c: limit write size on console * win32/win32.c (constat_parse): split long buffer and limit write size on a console, as well as rb_w32_write. [ruby-dev:50597] [Bug #14942] Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/version.h branches/ruby_2_4/win32/win32.c Index: ruby_2_4/win32/win32.c =================================================================== --- ruby_2_4/win32/win32.c (revision 64563) +++ ruby_2_4/win32/win32.c (revision 64564) @@ -6765,6 +6765,10 @@ constat_apply(HANDLE handle, struct cons https://github.com/ruby/ruby/blob/trunk/ruby_2_4/win32/win32.c#L6765 } } +/* get rid of console writing bug; assume WriteConsole and WriteFile + * on a console share the same limit. */ +static const long MAXSIZE_CONSOLE_WRITING = 31366; + /* License: Ruby's */ static long constat_parse(HANDLE h, struct constat *s, const WCHAR **ptrp, long *lenp) @@ -6819,7 +6823,7 @@ constat_parse(HANDLE h, struct constat * https://github.com/ruby/ruby/blob/trunk/ruby_2_4/win32/win32.c#L6823 } rest = 0; } - else { + else if ((rest = *lenp - len) < MAXSIZE_CONSOLE_WRITING) { continue; } *ptrp = ptr; @@ -7077,8 +7081,7 @@ rb_w32_write(int fd, const void *buf, si https://github.com/ruby/ruby/blob/trunk/ruby_2_4/win32/win32.c#L7081 ret = 0; retry: - /* get rid of console writing bug */ - len = (_osfile(fd) & FDEV) ? min(32 * 1024, size) : size; + len = (_osfile(fd) & FDEV) ? min(MAXSIZE_CONSOLE_WRITING, size) : size; size -= len; retry2: Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 64563) +++ ruby_2_4/version.h (revision 64564) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.5" #define RUBY_RELEASE_DATE "2018-08-27" -#define RUBY_PATCHLEVEL 321 +#define RUBY_PATCHLEVEL 322 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 8 Index: ruby_2_4 =================================================================== --- ruby_2_4 (revision 64563) +++ ruby_2_4 (revision 64564) Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /trunk:r64092 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/