From 4fa0395eb8db33b23c2a91e4b255021fd940d811 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 8 Jan 2011 12:53:41 +0100 Subject: [PATCH] Triviality in data_available() No functional change. Signed-off-by: Marco Costalba --- src/misc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/misc.cpp b/src/misc.cpp index 72f93c5e..d18f48d6 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -228,19 +228,19 @@ int data_available() int data_available() { static HANDLE inh = NULL; - static bool usePipe; + static bool usePipe = false; INPUT_RECORD rec[256]; DWORD dw, recCnt; if (!inh) { inh = GetStdHandle(STD_INPUT_HANDLE); - usePipe = !GetConsoleMode(inh, &dw); - if (!usePipe) + if (GetConsoleMode(inh, &dw)) { SetConsoleMode(inh, dw & ~(ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT)); FlushConsoleInputBuffer(inh); - } + } else + usePipe = true; } // If we're running under XBoard then we can't use PeekConsoleInput() as -- 2.39.2