kernel32: Only reset the console mode when it has been previously changed.

oldstable
Eric Pouech 2010-09-24 21:25:06 +02:00 committed by Alexandre Julliard
parent 1264ec931e
commit eabe3b34b2
1 changed files with 2 additions and 1 deletions

View File

@ -230,7 +230,8 @@ static BOOL restore_console_mode(HANDLE hin)
int fd;
BOOL ret;
if (RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != KERNEL32_CONSOLE_SHELL)
if (!S_termios_raw ||
RtlGetCurrentPeb()->ProcessParameters->ConsoleHandle != KERNEL32_CONSOLE_SHELL)
return TRUE;
if ((fd = get_console_bare_fd(hin)) == -1) return FALSE;
ret = tcsetattr(fd, TCSANOW, &S_termios) >= 0;