Deal with commented lines in UCI input
authormattginsberg <mlginsberg@gmail.com>
Sun, 28 Feb 2021 15:59:07 +0000 (07:59 -0800)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 7 Mar 2021 20:10:04 +0000 (21:10 +0100)
commands starting with '#' as the first character will be ignored

closes https://github.com/official-stockfish/Stockfish/pull/3378

No functional change

src/uci.cpp

index 47a8824e8035294ca11fc23a6a728ba4f85656bc..051ff2e02f4a16f4fe2cb777a1c76746428b88fc 100644 (file)
@@ -277,7 +277,7 @@ void UCI::loop(int argc, char* argv[]) {
       else if (token == "d")        sync_cout << pos << sync_endl;
       else if (token == "eval")     trace_eval(pos);
       else if (token == "compiler") sync_cout << compiler_info() << sync_endl;
-      else
+      else if (!token.empty() && token[0] != '#')
           sync_cout << "Unknown command: " << cmd << sync_endl;
 
   } while (token != "quit" && argc == 1); // Command line args are one-shot