mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 11:39:15 +00:00
Strip whitespace from beginning of string sent to set_option_value().
It turned out that the input sent to set_option_value() when it is called by set_option() in uci.cpp always started with at least one whitespace. In most cases, this is not a problem, because the majority of UCI options have numeric values. It did, however, cause a problem for UCI options with non-numerical values, like options of type CHECK and COMBO. In particular, changing the value of an option of type CHECK didn't work, because the comparisons with "true" and "false" would always return false. This means that the "Ponder" and "UCI_Chess960" options haven't been working for a while.
This commit is contained in:
parent
03f524c591
commit
174b40c28d
1 changed files with 5 additions and 0 deletions
|
@ -242,6 +242,11 @@ namespace {
|
|||
}
|
||||
if (token == "value")
|
||||
{
|
||||
// Skip whitespace. There should be a better way to do this, but
|
||||
// I don't know how...
|
||||
while(isspace(uip.get()));
|
||||
uip.unget();
|
||||
|
||||
getline(uip, token); // reads until end of line
|
||||
set_option_value(name, token);
|
||||
} else
|
||||
|
|
Loading…
Add table
Reference in a new issue