Fix Stockfish engine integration

Stockfish seems to go a bit nuts if passed an empty string for
command-line arguments.

https://bugzilla.gnome.org/show_bug.cgi?id=696474
This commit is contained in:
Michael Catanzaro 2013-05-11 22:24:08 -05:00
parent f4b137e318
commit 592754bed0
4 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@ public class AIProfile
public string protocol;
public string binary;
public string path;
public string args = "";
public string args;
public string[] easy_options;
public string[] normal_options;
public string[] hard_options;
@ -41,6 +41,8 @@ public List<AIProfile> load_ai_profiles (string filename)
profile.binary = file.get_value (name, "binary");
if (file.has_key (name, "args"))
profile.args = file.get_value (name, "args");
else
profile.args = null; // bgo#696474
profile.easy_options = load_options (file, name, "easy");
profile.normal_options = load_options (file, name, "normal");
profile.hard_options = load_options (file, name, "hard");

View file

@ -4,7 +4,7 @@ public class ChessEngineCECP : ChessEngine
private bool moving = false;
private string[] options;
public ChessEngineCECP (string binary, string args, string[] options)
public ChessEngineCECP (string binary, string? args, string[] options)
{
base (binary, args);
this.options = options;

View file

@ -5,7 +5,7 @@ public class ChessEngineUCI : ChessEngine
private string[] options;
private bool waiting_for_move;
public ChessEngineUCI (string binary, string args, string[] options)
public ChessEngineUCI (string binary, string? args, string[] options)
{
base (binary, args);
this.options = options;

View file

@ -30,7 +30,7 @@ public abstract class ChessEngine : Object
}
}
public ChessEngine (string binary, string args)
public ChessEngine (string binary, string? args)
{
this.binary = binary;
this.args = args;