msvcrt: Fix console detection in _write.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2020-09-18 17:15:08 +02:00 committed by Alexandre Julliard
parent 305aaec877
commit 155e2b2c3e
1 changed files with 2 additions and 2 deletions

View File

@ -3447,7 +3447,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
ioinfo *info = get_ioinfo(fd); ioinfo *info = get_ioinfo(fd);
HANDLE hand = info->handle; HANDLE hand = info->handle;
DWORD num_written, i; DWORD num_written, i;
BOOL console; BOOL console = FALSE;
if (hand == INVALID_HANDLE_VALUE || fd == MSVCRT_NO_CONSOLE_FD) if (hand == INVALID_HANDLE_VALUE || fd == MSVCRT_NO_CONSOLE_FD)
{ {
@ -3482,7 +3482,7 @@ int CDECL MSVCRT__write(int fd, const void* buf, unsigned int count)
return num_written; return num_written;
} }
console = MSVCRT__isatty(fd); if (MSVCRT__isatty(fd)) console = VerifyConsoleIoHandle(hand);
for (i = 0; i < count;) for (i = 0; i < count;)
{ {
const char *s = buf; const char *s = buf;