Clear token before reading from input

Previously token would keep its value from the previous line when an empty
line was input, leading to unexpected behaviour.

No functional change

Resolves #119
This commit is contained in:
Rodrigo Exterckötter Tjäder
2014-11-17 07:48:30 +08:00
committed by Gary Linscott
parent 3b1f552b08
commit 99f2c1a2a6

View File

@@ -157,6 +157,7 @@ void UCI::loop(int argc, char* argv[]) {
istringstream is(cmd); istringstream is(cmd);
token.clear(); // getline() could return empty or blank line
is >> skipws >> token; is >> skipws >> token;
if (token == "quit" || token == "stop" || token == "ponderhit") if (token == "quit" || token == "stop" || token == "ponderhit")