From 99f2c1a2a64cac94ee56324fa25f8fba04cd1347 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rodrigo=20Exterck=C3=B6tter=20Tj=C3=A4der?= Date: Mon, 17 Nov 2014 07:48:30 +0800 Subject: [PATCH 1/1] 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 --- src/uci.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uci.cpp b/src/uci.cpp index ee1b0702..0f67c440 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -157,6 +157,7 @@ void UCI::loop(int argc, char* argv[]) { istringstream is(cmd); + token.clear(); // getline() could return empty or blank line is >> skipws >> token; if (token == "quit" || token == "stop" || token == "ponderhit") -- 2.39.2