1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 15:29:55 +00:00

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.
This commit is contained in:
AnyOldName3 2024-04-16 01:10:39 +01:00
parent 901a17ab81
commit a7021bf9cc

View file

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