X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=061bbafca0cd1a4b7e0885407ce76a68938c1b23;hp=0b069e2f581e804589289d2fb18251c63cc7f0a7;hb=f5b8db7a1efc4ecaa6e1b385d1579abf5f5840fe;hpb=8d4caebabe91a473bd052d2f771e79a184902c31 diff --git a/src/search.cpp b/src/search.cpp index 0b069e2f..061bbafc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1944,10 +1944,7 @@ split_point_start: // At split points actual search starts from here // We are line oriented, don't read single chars std::string command; - if (!std::getline(std::cin, command)) - command = "quit"; - - if (command == "quit") + if (!std::getline(std::cin, command) || command == "quit") { // Quit the program as soon as possible Pondering = false; @@ -2025,20 +2022,12 @@ split_point_start: // At split points actual search starts from here std::string command; - while (true) - { - // Wait for a command from stdin - if (!std::getline(std::cin, command)) - command = "quit"; + // Wait for a command from stdin + while ( std::getline(std::cin, command) + && command != "ponderhit" && command != "stop" && command != "quit") {}; - if (command == "quit") - { - QuitRequest = true; - break; - } - else if (command == "ponderhit" || command == "stop") - break; - } + if (command != "ponderhit" && command != "stop") + QuitRequest = true; // Must be "quit" or getline() returned false }