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

ruby-changes:38529

From: usa <ko1@a...>
Date: Sat, 23 May 2015 03:13:43 +0900 (JST)
Subject: [ruby-changes:38529] usa:r50610 (trunk): * win32/win32.c (rb_w32_write_console): should return the count of

usa	2015-05-23 03:13:32 +0900 (Sat, 23 May 2015)

  New Revision: 50610

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

  Log:
    * win32/win32.c (rb_w32_write_console): should return the count of
      actually eaten characters, include escape sequences.

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50609)
+++ ChangeLog	(revision 50610)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat May 23 03:10:58 2015  NAKAMURA Usaku  <usa@r...>
+
+	* win32/win32.c (rb_w32_write_console): should return the count of
+	  actually eaten characters, include escape sequences.
+
 Fri May 22 22:36:14 2015  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* lib/prime.rb: Remove obsolete Prime.new
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 50609)
+++ win32/win32.c	(revision 50610)
@@ -6813,10 +6813,13 @@ rb_w32_write_console(uintptr_t strarg, i https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L6813
 	len = RSTRING_LEN(str) / sizeof(WCHAR);
 	break;
     }
+    reslen = 0;
     while (len > 0) {
 	long curlen = constat_parse(handle, s, (next = ptr, &next), &len);
+	reslen += next - ptr;
 	if (curlen > 0) {
-	    if (!WriteConsoleW(handle, ptr, curlen, &reslen, NULL)) {
+	    long written;
+	    if (!WriteConsoleW(handle, ptr, curlen, &written, NULL)) {
 		if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
 		    disable = TRUE;
 		reslen = (DWORD)-1L;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

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