1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00: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:
Marco Costalba 2009-05-02 11:14:45 +01:00
parent cd1cc39b04
commit aa5c375ca9

View file

@ -251,11 +251,13 @@ namespace {
if (token == "name") if (token == "name")
{ {
uip >> name; uip >> name;
uip >> token; while (!uip.eof())
while (!uip.eof() && token != "value")
{ {
name += (" " + token);
uip >> token; uip >> token;
if (token == "value")
break;
name += (" " + token);
} }
if (token == "value") if (token == "value")
{ {