summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/Terminal.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-04-23 00:25:37 (GMT)
committerBrad King <brad.king@kitware.com>2006-04-23 00:25:37 (GMT)
commit415b16aab9adc50f63f1de631ae36be310720530 (patch)
tree50b2412fc58d144b683539ff350cfab58412c145 /Source/kwsys/Terminal.c
parent071e26712c3d0075cdbbaac6259a105be00ddf30 (diff)
downloadCMake-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.c15
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);
}