在 2024-05-09 22:48, Peter Damianov 写道:
- h = GetStdHandle (STD_ERROR_HANDLE); - return (h != INVALID_HANDLE_VALUE) && (h != NULL) - && GetConsoleMode (h, &m); + handle = GetStdHandle (STD_ERROR_HANDLE); + isconsole = GetConsoleMode (handle, &mode);
Shouldn't `GetConsoleMode()` be called only when `handle` is valid? I think you may initialize `isconsole` to `false`; then only if the handle is valid, should it be set accordingly; and this function just returns `isconsole`.
The other two patches look good to me. -- Best regards, LIU Hao
OpenPGP_signature.asc
Description: OpenPGP digital signature