Clear std stream errors when reopening

Prior errors are no longer relevant.

Shouldn't make a difference unless you've tried printing something before the streams were set up.
pull/3235/head
AnyOldName3 9 months ago
parent 901a17ab81
commit a7021bf9cc

@ -73,16 +73,19 @@ namespace Debug
{ {
_wfreopen(L"CON", L"r", stdin); _wfreopen(L"CON", L"r", stdin);
freopen("CON", "r", stdin); freopen("CON", "r", stdin);
std::cin.clear();
} }
if (!outRedirected) if (!outRedirected)
{ {
_wfreopen(L"CON", L"w", stdout); _wfreopen(L"CON", L"w", stdout);
freopen("CON", "w", stdout); freopen("CON", "w", stdout);
std::cout.clear();
} }
if (!errRedirected) if (!errRedirected)
{ {
_wfreopen(L"CON", L"w", stderr); _wfreopen(L"CON", L"w", stderr);
freopen("CON", "w", stderr); freopen("CON", "w", stderr);
std::cerr.clear();
} }
return true; return true;

Loading…
Cancel
Save