diff --git a/components/debug/win32.cpp b/components/debug/win32.cpp index 976d5a4b0..1d5657d25 100644 --- a/components/debug/win32.cpp +++ b/components/debug/win32.cpp @@ -22,7 +22,7 @@ bool attachParentConsole() if (AttachConsole(ATTACH_PARENT_PROCESS)) { // start with consistent state - fflush(stdin); + fflush(stdout); fflush(stderr); std::cout.flush(); std::cerr.flush(); @@ -34,7 +34,7 @@ bool attachParentConsole() _wfreopen(L"CON", L"r", stdin); freopen("CON", "w", stdout); freopen("CON", "w", stderr); - freopen("CON", "w", stderr); + freopen("CON", "r", stdin); // it can be verified that input/output works as expected. #if 0