diff options
author | Brad King <brad.king@kitware.com> | 2016-10-25 13:13:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-25 13:13:48 (GMT) |
commit | 51cfba8c219a923c924349cd255a523eb797e104 (patch) | |
tree | f1bfe5cac8e41ccadb0ad57a0879f71e246a5c0c /Source/kwsys | |
parent | 2a567c68ce6605071f3e21638560493b71ed2841 (diff) | |
parent | 53862f04a0002894c0ef5aeb23d52495e5abe60d (diff) | |
download | CMake-51cfba8c219a923c924349cd255a523eb797e104.zip CMake-51cfba8c219a923c924349cd255a523eb797e104.tar.gz CMake-51cfba8c219a923c924349cd255a523eb797e104.tar.bz2 |
Merge branch 'upstream-KWSys' into update-kwsys
* upstream-KWSys:
KWSys 2016-10-23 (b630d2f5)
Diffstat (limited to 'Source/kwsys')
-rw-r--r-- | Source/kwsys/ConsoleBuf.hxx.in | 16 |
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; |