From 9c3ffe2474a1ed0280a35e00ff034b1866d9cec4 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 25 Sep 2007 10:57:49 -0400 Subject: [PATCH] BUG: fix problem with stdout and stderr not showing up in ms dos shells --- Source/cmSystemTools.cxx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 5ed8a75c5..2f5bb5b1c 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1979,7 +1979,17 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line, void cmSystemTools::DoNotInheritStdPipes() { -#ifdef _WIN32 +#ifdef _WIN32 + // Check to see if we are attached to a console + // if so, then do not stop the inherited pipes + // or stdout and stderr will not show up in dos + // shell windows + CONSOLE_SCREEN_BUFFER_INFO hOutInfo; + HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); + if(GetConsoleScreenBufferInfo(hOut, &hOutInfo)) + { + return; + } { HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); DuplicateHandle(GetCurrentProcess(), out,