X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=blobdiff_plain;f=uci.c;h=97c188f9e9ccae1c4fe6712b2b270fdc611f31a5;hp=ab2cea926cedf2dba1b223cdf17538543393f3b5;hb=1eb96d7121b161a946efaf18eded57d630f21ad1;hpb=0ea1b434ac6becf79c75d85ba27de5b89666a7c3 diff --git a/uci.c b/uci.c index ab2cea9..97c188f 100644 --- a/uci.c +++ b/uci.c @@ -5,6 +5,9 @@ * * Copyright 2006 Alessandro Scotti * + * Enhancement Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, + * 2016 Free Software Foundation, Inc. + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -18,28 +21,27 @@ * General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. + * along with this program. If not, see http://www.gnu.org/licenses/. * * ------------------------------------------------------------------------ */ #include +#include #include #include -#if HAVE_MALLOC_H - #include -#endif - #include "common.h" #include "backend.h" -Boolean GetArgValue(char *a); +Boolean GetArgValue(char *a); -void InitEngineUCI( const char * iniDir, ChessProgramState * cps ) +void +InitEngineUCI (const char *iniDir, ChessProgramState *cps) { // replace engine command line by adapter command with expanded meta-symbols if( cps->isUCI ) { char *p, *q; char polyglotCommand[MSG_SIZ]; + if(cps->isUCI == 2) p = appData.ucciAdapter; else p = appData.adapterCommand; q = polyglotCommand; while(*p) { @@ -50,7 +52,7 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps ) *s++ = cps == &first ? 'f' : 's'; p++; } - while(*p >= '0' && *p) *s++ = *p++; // copy option name + while(isdigit(*p) || isalpha(*p)) *s++ = *p++; // copy option name *s = NULLCHAR; if(cps == &second) { // change options for first into those for second engine if(strstr(buf, "first") == buf) sprintf(argName, "second%s", buf+5); else