diff options
author | Brad King <brad.king@kitware.com> | 2006-04-23 00:25:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-23 00:25:37 (GMT) |
commit | 415b16aab9adc50f63f1de631ae36be310720530 (patch) | |
tree | 50b2412fc58d144b683539ff350cfab58412c145 /Source/kwsys/Terminal.c | |
parent | 071e26712c3d0075cdbbaac6259a105be00ddf30 (diff) | |
download | CMake-415b16aab9adc50f63f1de631ae36be310720530.zip CMake-415b16aab9adc50f63f1de631ae36be310720530.tar.gz CMake-415b16aab9adc50f63f1de631ae36be310720530.tar.bz2 |
BUG: Fixed uninitialized variable when not building with windows console support.
Diffstat (limited to 'Source/kwsys/Terminal.c')
-rw-r--r-- | Source/kwsys/Terminal.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/kwsys/Terminal.c b/Source/kwsys/Terminal.c index 2f5dfa3..9886c24 100644 --- a/Source/kwsys/Terminal.c +++ b/Source/kwsys/Terminal.c @@ -62,24 +62,23 @@ static void kwsysTerminalSetConsoleColor(HANDLE hOut, void kwsysTerminal_cfprintf(int color, FILE* stream, const char* format, ...) { /* Setup the stream with the given color if possible. */ - int pipeIsConsole; - int pipeIsVT100; + int pipeIsConsole = 0; + int pipeIsVT100 = 0; int default_vt100 = color & kwsysTerminal_Color_AssumeTTY; int default_tty = color & kwsysTerminal_Color_AssumeTTY; #if defined(KWSYS_TERMINAL_SUPPORT_CONSOLE) CONSOLE_SCREEN_BUFFER_INFO hOutInfo; HANDLE hOut = kwsysTerminalGetStreamHandle(stream); - pipeIsConsole = GetConsoleScreenBufferInfo(hOut, &hOutInfo); - if(pipeIsConsole) + if(GetConsoleScreenBufferInfo(hOut, &hOutInfo)) { + pipeIsConsole = 1; kwsysTerminalSetConsoleColor(hOut, &hOutInfo, stream, color); } #endif - pipeIsVT100 = (!pipeIsConsole && - kwsysTerminalStreamIsVT100(stream, - default_vt100, default_tty)); - if(pipeIsVT100) + if(!pipeIsConsole && kwsysTerminalStreamIsVT100(stream, + default_vt100, default_tty)) { + pipeIsVT100 = 1; kwsysTerminalSetVT100Color(stream, color); } |