[PATCH] [Kernel32]: only reset the console mode when it has been previously changed

Eric Pouech eric.pouech at orange.fr
Fri Sep 24 14:25:06 CDT 2010


(fix to #24483)

A+
---

 dlls/kernel32/console.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 064cd53..4bf5780 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -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;






More information about the wine-patches mailing list