Commit 2586bc8d authored by Brad King's avatar Brad King
Browse files

BUG: Fixed uninitialized variable when not building with windows console support.

parent 1eec41db
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment