mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 03:56:50 +08:00
Improve handling of the debug log file.
Fix handling of empty strings in uci options and reassigning of the log file Fixes https://github.com/official-stockfish/Stockfish/issues/3650 Closes https://github.com/official-stockfish/Stockfish/pull/3655 No functional change
This commit is contained in:
committed by
Joost VandeVondele
parent
1946a67567
commit
ccf0239bc4
15
src/misc.cpp
15
src/misc.cpp
@@ -110,7 +110,14 @@ public:
|
||||
|
||||
static Logger l;
|
||||
|
||||
if (!fname.empty() && !l.file.is_open())
|
||||
if (l.file.is_open())
|
||||
{
|
||||
cout.rdbuf(l.out.buf);
|
||||
cin.rdbuf(l.in.buf);
|
||||
l.file.close();
|
||||
}
|
||||
|
||||
if (!fname.empty())
|
||||
{
|
||||
l.file.open(fname, ifstream::out);
|
||||
|
||||
@@ -123,12 +130,6 @@ public:
|
||||
cin.rdbuf(&l.in);
|
||||
cout.rdbuf(&l.out);
|
||||
}
|
||||
else if (fname.empty() && l.file.is_open())
|
||||
{
|
||||
cout.rdbuf(l.out.buf);
|
||||
cin.rdbuf(l.in.buf);
|
||||
l.file.close();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user