From 7902d6089eddba7f2e3be922bf069fdb19242516 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Fri, 5 Aug 2011 07:15:45 +0100 Subject: [PATCH] Fix silly bug in uci loop After issuing "go"-command, at the end of the search SF shows: "Unknown command: ...". Spotted by Joona. No functional change. Signed-off-by: Marco Costalba --- src/uci.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/uci.cpp b/src/uci.cpp index d7c65e10..dbf735af 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -58,20 +58,21 @@ void uci_loop() { Position pos(StarFEN, false, 0); // The root position string cmd, token; + bool quit = false; - while (getline(cin, cmd)) + while (!quit && getline(cin, cmd)) { istringstream is(cmd); is >> skipws >> token; if (token == "quit") - break; + quit = true; - if (token == "go" && !go(pos, is)) - break; + else if (token == "go") + quit = !go(pos, is); - if (token == "ucinewgame") + else if (token == "ucinewgame") pos.from_fen(StarFEN, false); else if (token == "isready") -- 2.39.2