aboutsummaryrefslogtreecommitdiffstats
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
commit52b3b3256c45908b76d20a457e4dce72eb1aa140 (patch)
tree96457320cbea3eb2a4372691cc1c3befb3ce990e /win32
parenta42cb3ca389c438f930361ff297899e63180d100 (diff)
downloadruby-52b3b3256c45908b76d20a457e4dce72eb1aa140.tar.gz
* 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 c4be85b9fe..3b100bf4db 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;