X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.c;h=17145a768ee9ba39304e895f901e788405394623;hb=a009a27e8c1e0bfa818f12fdcae675d0babc510a;hp=f78fb2c0473ae50e5a5cd14a72700dc575c87575;hpb=7b1579c574c06f880cc6c01874416dde0374aab6;p=xboard.git diff --git a/uci.c b/uci.c index f78fb2c..17145a7 100644 --- a/uci.c +++ b/uci.c @@ -5,6 +5,8 @@ * * Copyright 2006 Alessandro Scotti * + * Enhancement Copyright 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. + * * ------------------------------------------------------------------------ * * GNU XBoard is free software: you can redistribute it and/or modify @@ -23,6 +25,7 @@ * ------------------------------------------------------------------------ */ #include +#include #include #include @@ -30,12 +33,14 @@ #include "backend.h" 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) { @@ -46,7 +51,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