diff options
author | KWSys Upstream <kwrobot@kitware.com> | 2016-10-23 01:32:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-25 13:13:46 (GMT) |
commit | 53862f04a0002894c0ef5aeb23d52495e5abe60d (patch) | |
tree | 50c7e3428a24291c0315ba2c7cdcf41d97cb2355 | |
parent | bf28a3873d633d233991f14e8e4d10c76f410deb (diff) | |
download | CMake-53862f04a0002894c0ef5aeb23d52495e5abe60d.zip CMake-53862f04a0002894c0ef5aeb23d52495e5abe60d.tar.gz CMake-53862f04a0002894c0ef5aeb23d52495e5abe60d.tar.bz2 |
KWSys 2016-10-23 (b630d2f5)
Code extracted from:
http://public.kitware.com/KWSys.git
at commit b630d2f5575be7d70c214bfffc57aaf5069c6369 (master).
Upstream Shortlog
-----------------
Dāvis Mosāns (1):
b630d2f5 ConsoleBuf: Check for actual console with GetConsoleMode
-rw-r--r-- | ConsoleBuf.hxx.in | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ConsoleBuf.hxx.in b/ConsoleBuf.hxx.in index 8aeeda1..2496b45 100644 --- a/ConsoleBuf.hxx.in +++ b/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; |