From ffbbe6fcce54884e261486fdf9e302df315f2c7c Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 21 Oct 2014 22:40:39 +0200 Subject: [PATCH] Prevent unknown variant getting button in -ncp mode Normally we fake the engines play the requested variant, for the benefit of engines that do not send a variants feature (e.g. v1 engines). But this should not be done if there is no engine, as it would lead XBoard to believe an unknown variant name is an engine-defined variant supported by a currently loaded engine, and create a button for it in the New Variant dialog. --- backend.c | 4 ++-- po/da.po | 2 +- po/de.po | 2 +- po/es.po | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend.c b/backend.c index 4cc497f..454d16b 100644 --- a/backend.c +++ b/backend.c @@ -848,7 +848,7 @@ InitEngine (ChessProgramState *cps, int n) if(cps->tidy == NULL) cps->tidy = (char*) malloc(MSG_SIZ); TidyProgramName(cps->program, cps->host, cps->tidy); cps->matchWins = 0; - ASSIGN(cps->variants, appData.variant); + ASSIGN(cps->variants, appData.noChessProgram ? "" : appData.variant); cps->analysisSupport = 2; /* detect */ cps->analyzing = FALSE; cps->initDone = FALSE; @@ -1202,7 +1202,7 @@ InitBackEnd1 () return; case VariantNormal: /* definitely works! */ - if(strcmp(appData.variant, "normal") && appData.chessProgram) { // [HGM] hope this is an engine-defined variant + if(strcmp(appData.variant, "normal") && !appData.noChessProgram) { // [HGM] hope this is an engine-defined variant safeStrCpy(engineVariant, appData.variant, MSG_SIZ); return; } diff --git a/po/da.po b/po/da.po index b55cd13..0ad0efd 100644 --- a/po/da.po +++ b/po/da.po @@ -25,10 +25,10 @@ msgstr "" "PO-Revision-Date: 2012-03-06 12:27+0100\n" "Last-Translator: Byrial Ole Jensen \n" "Language-Team: Danish \n" -"Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: da\n" "X-Generator: Lokalize 1.2\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" diff --git a/po/de.po b/po/de.po index 4257a30..2964070 100644 --- a/po/de.po +++ b/po/de.po @@ -11,10 +11,10 @@ msgstr "" "PO-Revision-Date: 2013-11-24 18:22-0800\n" "Last-Translator: Arun Persaud \n" "Language-Team: German \n" -"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: args.h:839 diff --git a/po/es.po b/po/es.po index f388c7a..4068a17 100644 --- a/po/es.po +++ b/po/es.po @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2014-10-01 23:14+0200\n" "Last-Translator: Antonio Ceballos \n" "Language-Team: Spanish \n" -"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: args.h:839 -- 1.7.0.4