BUG: Fixed uninitialized variable when not building with windows console support.
This commit is contained in:
parent
071e26712c
commit
415b16aab9
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue