From: cloudfish <13962946+cloudfish@users.noreply.github.com> Date: Wed, 1 Dec 2021 08:05:54 +0000 (+0800) Subject: Fix search for option aliases in UCI dialects (#415) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=29ce4b8b954abb3e82b150aa88c4036544689ff9;p=fairystockfish.git Fix search for option aliases in UCI dialects (#415) --- diff --git a/src/uci.cpp b/src/uci.cpp index 1903731..73acbf7 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -115,7 +115,7 @@ namespace { if (Options.count(name)) Options[name] = value; - // UCI dialects do not allow spaces + // Deal with option name aliases in UCI dialects else if (is_valid_option(Options, name)) Options[name] = value; else @@ -568,7 +568,8 @@ bool UCI::is_valid_option(UCI::OptionsMap& options, std::string& name) { std::string protocol = options["Protocol"]; for (const auto& it : options) { - if (options.key_comp()(option_name(it.first, protocol), name)) + std::string optionName = option_name(it.first, protocol); + if (!options.key_comp()(optionName, name) && !options.key_comp()(name, optionName)) { name = it.first; return true;