mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-18 16:16:23 +08:00
Fix a very old UCI option parsing bug
We currently fail on an option with a sapece in the name, as example setoption name Clear Hash returns error message "Option Clear not found". This patch fixes this off-by-one type bug. Thanks to Joona for spotting this. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
10
src/uci.cpp
10
src/uci.cpp
@@ -251,11 +251,13 @@ namespace {
|
||||
if (token == "name")
|
||||
{
|
||||
uip >> name;
|
||||
uip >> token;
|
||||
while (!uip.eof() && token != "value")
|
||||
while (!uip.eof())
|
||||
{
|
||||
name += (" " + token);
|
||||
uip >> token;
|
||||
uip >> token;
|
||||
if (token == "value")
|
||||
break;
|
||||
|
||||
name += (" " + token);
|
||||
}
|
||||
if (token == "value")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user