[rpcli] vt.cpp, win32_console_print_ansi_color(): Get the console handle from ci_stdout.
Some checks failed
Codecov / run (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled

This commit is contained in:
David Korth 2025-05-01 22:45:43 -04:00
parent 917f0a497a
commit e9dcd3f131

View File

@ -383,13 +383,7 @@ static constexpr inline bool vt_isalpha(char c)
*/
int win32_console_print_ansi_color(const char *str)
{
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
assert(hStdOut != nullptr && hStdOut != INVALID_HANDLE_VALUE);
if (!hStdOut || hStdOut == INVALID_HANDLE_VALUE) {
// Cannot access the console handle...
return -ENOTTY;
}
HANDLE hStdOut = ci_stdout.hConsole;
WORD wAttributes = ci_stdout.wAttributesOrig;
// Bold/bright tracking
// FIXME: Set one of these if wAttributesOrig has FOREGROUND_INTENSITY?