ruby-changes:18284
From: yugui <ko1@a...>
Date: Thu, 23 Dec 2010 19:49:25 +0900 (JST)
Subject: [ruby-changes:18284] Ruby:r30307 (ruby_1_9_2): merges r29980,r30017,r30018,r30019 and r30020 from trunk into ruby_1_9_2.
yugui 2010-12-23 19:49:03 +0900 (Thu, 23 Dec 2010) New Revision: 30307 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30307 Log: merges r29980,r30017,r30018,r30019 and r30020 from trunk into ruby_1_9_2. -- * win32/win32.c (rb_w32_read): read only 1 byte at once on console. workaround of Windows bug. see [ruby-core:33460]. this is not the final solution. -- * win32/win32.c (rb_w32_read): workaround for console reading troubles. fixed [ruby-core:33511] -- * win32/win32.c (rb_w32_read): rollback debug code of previous commit. -- * win32/win32.c (rb_w43_read): more fix. [ruby-core:33513] -- * ChangeLog: typo. Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/version.h branches/ruby_1_9_2/win32/win32.c Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 30306) +++ ruby_1_9_2/ChangeLog (revision 30307) @@ -1,3 +1,18 @@ +Thu Dec 2 15:31:14 2010 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_read): more fix. [ruby-core:33513] + +Thu Dec 2 13:41:43 2010 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_read): workaround for console reading troubles. + fixed [ruby-core:33511] + +Tue Nov 30 12:23:52 2010 NAKAMURA Usaku <usa@r...> + + * win32/win32.c (rb_w32_read): read only 1 byte at once on console. + workaround of Windows bug. see [ruby-core:33460]. + this is not the final solution. + Mon Nov 29 22:55:24 2010 Nobuyoshi Nakada <nobu@r...> * lib/uri/common.rb (URI::WFKV_): get rid of backtrack explosion Index: ruby_1_9_2/win32/win32.c =================================================================== --- ruby_1_9_2/win32/win32.c (revision 30306) +++ ruby_1_9_2/win32/win32.c (revision 30307) @@ -5056,6 +5056,7 @@ size_t len; size_t ret; OVERLAPPED ol, *pol = NULL; + BOOL isconsole; int start = 0; if (is_socket(sock)) @@ -5073,16 +5074,18 @@ MTHREAD_ONLY(EnterCriticalSection(&(_pioinfo(fd)->lock))); if (!size || _osfile(fd) & FEOFLAG) { + _set_osflags(fd, _osfile(fd) & ~FEOFLAG); MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock)); return 0; } ret = 0; + isconsole = is_console(_osfhnd(fd)); retry: /* get rid of console reading bug */ - if (is_console(_osfhnd(fd))) { + if (isconsole) { if (start) - len = min(16 * 1024, size); + len = 1; else { len = 0; start = 1; @@ -5178,12 +5181,15 @@ } ret += read; - if (read == len) { - buf = (char *)buf + len; - if (size > 0) + if (read >= len) { + buf = (char *)buf + read; + if (!(isconsole && len == 1 && *((char *)buf - 1) == '\n') && size > 0) goto retry; } + if (read == 0) + _set_osflags(fd, _osfile(fd) | FEOFLAG); + MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock)); return ret; Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 30306) +++ ruby_1_9_2/version.h (revision 30307) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 112 +#define RUBY_PATCHLEVEL 113 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/