From c260fe245921dcbd737faaf4638e4fb3354717f0 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 2 Nov 2010 13:06:58 +0100 Subject: [PATCH] Remember values set by -firstOptions, -secondOptions When an engine announces its option features, and the option name matches that of a setting given in -first/secondOptions, the engine is sent hte specified value, but this value was not remembered as current value (but the latter was left at the engine-announced default), leading to inconsistent behavior in the Engine #N Settings dialog. --- backend.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 07df9ce..de835ae 100644 --- a/backend.c +++ b/backend.c @@ -13803,6 +13803,20 @@ ParseOption(Option *opt, ChessProgramState *cps) if(p && (p == cps->optionSettings || p[-1] == ',')) { snprintf(buf, MSG_SIZ, "option %s", p); if(p = strstr(buf, ",")) *p = 0; + if(q = strchr(buf, '=')) switch(opt->type) { + case ComboBox: + for(n=0; nmax; n++) + if(!strcmp(((char**)opt->textValue)[n], q+1)) opt->value = n; + break; + case TextBox: + safeStrCpy(opt->textValue, q+1, MSG_SIZ - (opt->textValue - opt->name)); + break; + case Spin: + case CheckBox: + opt->value = atoi(q+1); + default: + break; + } strcat(buf, "\n"); SendToProgram(buf, cps); } -- 1.7.0.4