Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -62,24 +62,23 @@ static void kwsysTerminalSetConsoleColor(HANDLE hOut, ...@@ -62,24 +62,23 @@ static void kwsysTerminalSetConsoleColor(HANDLE hOut,
void kwsysTerminal_cfprintf(int color, FILE* stream, const char* format, ...) void kwsysTerminal_cfprintf(int color, FILE* stream, const char* format, ...)
{ {
/* Setup the stream with the given color if possible. */ /* Setup the stream with the given color if possible. */
int pipeIsConsole; int pipeIsConsole = 0;
int pipeIsVT100; int pipeIsVT100 = 0;
int default_vt100 = color & kwsysTerminal_Color_AssumeTTY; int default_vt100 = color & kwsysTerminal_Color_AssumeTTY;
int default_tty = color & kwsysTerminal_Color_AssumeTTY; int default_tty = color & kwsysTerminal_Color_AssumeTTY;
#if defined(KWSYS_TERMINAL_SUPPORT_CONSOLE) #if defined(KWSYS_TERMINAL_SUPPORT_CONSOLE)
CONSOLE_SCREEN_BUFFER_INFO hOutInfo; CONSOLE_SCREEN_BUFFER_INFO hOutInfo;
HANDLE hOut = kwsysTerminalGetStreamHandle(stream); HANDLE hOut = kwsysTerminalGetStreamHandle(stream);
pipeIsConsole = GetConsoleScreenBufferInfo(hOut, &hOutInfo); if(GetConsoleScreenBufferInfo(hOut, &hOutInfo))
if(pipeIsConsole)
{ {
pipeIsConsole = 1;
kwsysTerminalSetConsoleColor(hOut, &hOutInfo, stream, color); kwsysTerminalSetConsoleColor(hOut, &hOutInfo, stream, color);
} }
#endif #endif
pipeIsVT100 = (!pipeIsConsole && if(!pipeIsConsole && kwsysTerminalStreamIsVT100(stream,
kwsysTerminalStreamIsVT100(stream, default_vt100, default_tty))
default_vt100, default_tty));
if(pipeIsVT100)
{ {
pipeIsVT100 = 1;
kwsysTerminalSetVT100Color(stream, color); kwsysTerminalSetVT100Color(stream, color);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment