Prevent unknown variant getting button in -ncp mode
authorH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 21 Oct 2014 20:40:39 +0000 (22:40 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Tue, 21 Oct 2014 20:40:39 +0000 (22:40 +0200)
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
po/da.po
po/de.po
po/es.po

index 4cc497f..454d16b 100644 (file)
--- 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;
        }
index b55cd13..0ad0efd 100644 (file)
--- 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 <byrial@vip.cybercity.dk>\n"
 "Language-Team: Danish <dansk@dansk-gruppen.dk>\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"
 
index 4257a30..2964070 100644 (file)
--- 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 <arun@nubati.net>\n"
 "Language-Team: German <translation-team-de@lists.sourceforge.net>\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
index f388c7a..4068a17 100644 (file)
--- 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 <aceballos@gmail.com>\n"
 "Language-Team: Spanish <es@tp.org.es>\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