[前][次][番号順一覧][スレッド一覧]

ruby-changes:18291

From: yugui <ko1@a...>
Date: Thu, 23 Dec 2010 21:45:31 +0900 (JST)
Subject: [ruby-changes:18291] Ruby:r30314 (ruby_1_9_2): merges r30104 from trunk into ruby_1_9_2.

yugui	2010-12-23 21:45:13 +0900 (Thu, 23 Dec 2010)

  New Revision: 30314

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30314

  Log:
    merges r30104 from trunk into ruby_1_9_2.
    --
    * win32/win32.c (rb_w32_read): fixed more for readline, and so on. [ruby-core:33511]

  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 30313)
+++ ruby_1_9_2/ChangeLog	(revision 30314)
@@ -1,3 +1,8 @@
+Tue Dec  7 00:27:14 2010  Masaya Tarui  <tarui@r...>
+
+	* win32/win32.c (rb_w32_read): fixed more for readline,
+	  and so on. [ruby-core:33511]
+
 Mon Dec  6 18:56:42 2010  Kazuhiro NISHIYAMA  <zn@m...>
 
 	* test/ruby/test_string.rb (TestString#test_scan): add a test for
Index: ruby_1_9_2/win32/win32.c
===================================================================
--- ruby_1_9_2/win32/win32.c	(revision 30313)
+++ ruby_1_9_2/win32/win32.c	(revision 30314)
@@ -5057,6 +5057,7 @@
     size_t ret;
     OVERLAPPED ol, *pol = NULL;
     BOOL isconsole;
+    BOOL islineinput;
     int start = 0;
 
     if (is_socket(sock))
@@ -5081,6 +5082,11 @@
 
     ret = 0;
     isconsole = is_console(_osfhnd(fd));
+    if(isconsole){
+	DWORD mode;
+	GetConsoleMode((HANDLE)_osfhnd(fd),&mode);
+	islineinput = (mode & ENABLE_LINE_INPUT) != 0;
+    }
   retry:
     /* get rid of console reading bug */
     if (isconsole) {
@@ -5183,7 +5189,7 @@
     ret += read;
     if (read >= len) {
 	buf = (char *)buf + read;
-	if (!(isconsole && len == 1 && *((char *)buf - 1) == '\n') && size > 0)
+	if (!(isconsole && len == 1 && (!islineinput || *((char *)buf - 1) == '\n')) && size > 0)
 	    goto retry;
     }
     if (read == 0)
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 30313)
+++ ruby_1_9_2/version.h	(revision 30314)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 119
+#define RUBY_PATCHLEVEL 120
 #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/

[前][次][番号順一覧][スレッド一覧]