* win32/win32.c (rb_w32_write_console): fixed indentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
53d06bb081
commit
3d24592008
@ -1,3 +1,7 @@
|
|||||||
|
Mon Nov 29 14:10:55 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (rb_w32_write_console): fixed indentation.
|
||||||
|
|
||||||
Sun Nov 28 22:13:39 2010 Koichi Sasada <ko1@atdot.net>
|
Sun Nov 28 22:13:39 2010 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* thread_pthread.c (NATIVE_MUTEX_LOCK_DEBUG): move and use it.
|
* thread_pthread.c (NATIVE_MUTEX_LOCK_DEBUG): move and use it.
|
||||||
|
@ -5296,15 +5296,16 @@ rb_w32_write_console(VALUE str, int fd)
|
|||||||
if (disable) return -1L;
|
if (disable) return -1L;
|
||||||
handle = (HANDLE)_osfhnd(fd);
|
handle = (HANDLE)_osfhnd(fd);
|
||||||
if (!GetConsoleMode(handle, &dwMode) ||
|
if (!GetConsoleMode(handle, &dwMode) ||
|
||||||
!rb_econv_has_convpath_p(rb_enc_name(rb_enc_get(str)), "UTF-16LE"))
|
!rb_econv_has_convpath_p(rb_enc_name(rb_enc_get(str)), "UTF-16LE"))
|
||||||
return -1L;
|
return -1L;
|
||||||
|
|
||||||
str = rb_str_encode(str, rb_enc_from_encoding(rb_enc_find("UTF-16LE")), 0,
|
str = rb_str_encode(str, rb_enc_from_encoding(rb_enc_find("UTF-16LE")), 0,
|
||||||
Qnil);
|
Qnil);
|
||||||
if (!WriteConsoleW(handle, (LPWSTR)RSTRING_PTR(str), RSTRING_LEN(str)/2, &reslen, NULL)) {
|
if (!WriteConsoleW(handle, (LPWSTR)RSTRING_PTR(str), RSTRING_LEN(str)/2,
|
||||||
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
&reslen, NULL)) {
|
||||||
disable = TRUE;
|
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||||
return -1L;
|
disable = TRUE;
|
||||||
|
return -1L;
|
||||||
}
|
}
|
||||||
return (long)reslen;
|
return (long)reslen;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user