Skip to content

Commit

Permalink
* win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
Browse files Browse the repository at this point in the history
  console supports it natively.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54026 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Mar 8, 2016
1 parent a5be0fb commit 693b335
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Tue Mar 8 16:54:29 2016 NAKAMURA Usaku <usa@ruby-lang.org>

* win32/win32.c (rb_w32_write_console): stop the VT100 emulation if the
console supports it natively.

Tue Mar 8 08:13:01 2016 Rei Odaira <Rei.Odaira@gmail.com>

* test/net/imap/test_imap.rb (test_idle_timeout): Because of the
Expand Down
32 changes: 21 additions & 11 deletions win32/win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -7069,19 +7069,29 @@ rb_w32_write_console(uintptr_t strarg, int fd)
break;
}
reslen = 0;
while (len > 0) {
long curlen = constat_parse(handle, s, (next = ptr, &next), &len);
reslen += next - ptr;
if (curlen > 0) {
DWORD written;
if (!WriteConsoleW(handle, ptr, curlen, &written, NULL)) {
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
disable = TRUE;
reslen = (DWORD)-1L;
break;
if (dwMode & 4) { /* ENABLE_VIRTUAL_TERMINAL_PROCESSING */
DWORD written;
if (!WriteConsoleW(handle, ptr, len, &written, NULL)) {
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
disable = TRUE;
reslen = (DWORD)-1L;
}
}
else {
while (len > 0) {
long curlen = constat_parse(handle, s, (next = ptr, &next), &len);
reslen += next - ptr;
if (curlen > 0) {
DWORD written;
if (!WriteConsoleW(handle, ptr, curlen, &written, NULL)) {
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
disable = TRUE;
reslen = (DWORD)-1L;
break;
}
}
ptr = next;
}
ptr = next;
}
RB_GC_GUARD(str);
if (wbuffer) free(wbuffer);
Expand Down

0 comments on commit 693b335

Please sign in to comment.