X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=2f3db5ed1ba46999d21975ebf7af5048d4d25a64;hb=4b2e076784b6bfd57781000e1ec809a1dc7ba4a1;hp=c18fa3eb6ea146641af06f9fa9bca4745d9079a4;hpb=28a742f1ef86e353f4eed6ec0841d483b29a5794;p=xboard.git diff --git a/backend.c b/backend.c index c18fa3e..2f3db5e 100644 --- a/backend.c +++ b/backend.c @@ -10935,23 +10935,27 @@ ResendOptions (ChessProgramState *cps) char buf[MSG_SIZ]; Option *opt = cps->option; for(i=0; inrOptions; i++, opt++) { + *buf = NULLCHAR; switch(opt->type) { case Spin: case Slider: case CheckBox: + if(opt->value != *(int*) (opt->name + MSG_SIZ - 104)) snprintf(buf, MSG_SIZ, "option %s=%d\n", opt->name, opt->value); break; case ComboBox: - snprintf(buf, MSG_SIZ, "option %s=%s\n", opt->name, opt->choice[opt->value]); + if(opt->value != *(int*) (opt->name + MSG_SIZ - 104)) + snprintf(buf, MSG_SIZ, "option %s=%s\n", opt->name, opt->choice[opt->value]); break; default: + if(strcmp(opt->textValue, opt->name + MSG_SIZ - 100)) snprintf(buf, MSG_SIZ, "option %s=%s\n", opt->name, opt->textValue); break; case Button: case SaveButton: continue; } - SendToProgram(buf, cps); + if(*buf) SendToProgram(buf, cps); } } @@ -17281,6 +17285,8 @@ ParseOption (Option *opt, ChessProgramState *cps) strcat(buf, "\n"); SendToProgram(buf, cps); } + *(int*) (opt->name + MSG_SIZ - 104) = opt->value; // hide default values somewhere + if(opt->target == &opt->textValue) strncpy(opt->name + MSG_SIZ - 100, opt->textValue, 99); return TRUE; }