summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-10-26 13:28:16 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-10-26 13:28:16 (GMT)
commitfa15858a7eee3a6feb84bd39b01478c2116ab21e (patch)
tree514853529940517802dfd11d1604212ee82b590c
parent1c8b99ce0b8e3a7a78b029a0cf18dc7256be6aee (diff)
parent51cfba8c219a923c924349cd255a523eb797e104 (diff)
downloadCMake-fa15858a7eee3a6feb84bd39b01478c2116ab21e.zip
CMake-fa15858a7eee3a6feb84bd39b01478c2116ab21e.tar.gz
CMake-fa15858a7eee3a6feb84bd39b01478c2116ab21e.tar.bz2
Merge topic 'update-kwsys'
51cfba8c Merge branch 'upstream-KWSys' into update-kwsys 53862f04 KWSys 2016-10-23 (b630d2f5)
-rw-r--r--Source/kwsys/ConsoleBuf.hxx.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/kwsys/ConsoleBuf.hxx.in b/Source/kwsys/ConsoleBuf.hxx.in
index 8aeeda1..2496b45 100644
--- a/Source/kwsys/ConsoleBuf.hxx.in
+++ b/Source/kwsys/ConsoleBuf.hxx.in
@@ -239,8 +239,12 @@ namespace @KWSYS_NAMESPACE@
m_activeInputCodepage = input_file_codepage;
break;
case FILE_TYPE_CHAR:
- m_isConsoleInput = true;
- break;
+ // Check for actual console.
+ DWORD consoleMode;
+ m_isConsoleInput = GetConsoleMode(m_hInput, &consoleMode) == 0 ? false : true;
+ if (m_isConsoleInput) {
+ break;
+ }
case FILE_TYPE_PIPE:
m_activeInputCodepage = input_pipe_codepage;
break;
@@ -259,8 +263,12 @@ namespace @KWSYS_NAMESPACE@
m_activeOutputCodepage = output_file_codepage;
break;
case FILE_TYPE_CHAR:
- m_isConsoleOutput = true;
- break;
+ // Check for actual console.
+ DWORD consoleMode;
+ m_isConsoleOutput = GetConsoleMode(m_hOutput, &consoleMode) == 0 ? false : true;
+ if (m_isConsoleOutput) {
+ break;
+ }
case FILE_TYPE_PIPE:
m_activeOutputCodepage = output_pipe_codepage;
break;