summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-22 18:13:32 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-22 18:13:32 +0000
commit7ceb9ecc31238523911b8d1c66b47a990132c0b2 (patch)
tree96457320cbea3eb2a4372691cc1c3befb3ce990e /win32
parent3f4aab1621ad1395c4abb775260638aaf620f5be (diff)
* win32/win32.c (rb_w32_write_console): should return the count of
actually eaten characters, include escape sequences. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c4be85b..3b100bf 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -6813,10 +6813,13 @@ rb_w32_write_console(uintptr_t strarg, int fd)
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;