X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.c;fp=uci.c;h=e63fb02ee10aa8b02f04e8e53dab737dea1a51d9;hb=762e18baef5f815cc46019ba3e082bd5ec1980f6;hp=ff0e3367dad83ba26a061dfceab7fd0930e883a6;hpb=86517e539f33650be656c482020a878fec0723c9;p=xboard.git diff --git a/uci.c b/uci.c index ff0e336..e63fb02 100644 --- a/uci.c +++ b/uci.c @@ -19,17 +19,21 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * ------------------------------------------------------------------------ */ -#include "config.h" - -#include /* required for all Windows applications */ - #include #include #include +#ifdef WIN32 +// [HGM] this was probably a Windows-specific constant. Needs to be defined here now I +// threw out the Windows-specific includes (winboard.h etc.). 100 seems enough. +#include +#define SLASH_CHAR "\\" +#else +#define MAX_PATH 100 +#define SLASH_CHAR "/" +#endif + #include "common.h" -#include "winboard.h" -#include "frontend.h" #include "backend.h" #define INIFILE_PREFIX "polyglot_" @@ -37,6 +41,7 @@ #define INIFILE_SUFFIX_2ND "2nd" #define INIFILE_EXT ".ini" + static const char * GetIniFilename( ChessProgramState * cps ) { return cps == &first ? INIFILE_PREFIX INIFILE_SUFFIX_1ST INIFILE_EXT : INIFILE_PREFIX INIFILE_SUFFIX_2ND INIFILE_EXT; @@ -52,16 +57,21 @@ void InitEngineUCI( const char * iniDir, ChessProgramState * cps ) /* Build name of initialization file */ if( strchr( iniDir, ' ' ) != NULL ) { char iniDirShort[ MAX_PATH ]; - +#ifdef WIN32 GetShortPathName( iniDir, iniDirShort, sizeof(iniDirShort) ); strcpy( polyglotIniFile, iniDirShort ); +#else + // [HGM] UCI: not sure if this works, but GetShortPathName seems Windows pecific + // and names with spaces in it do not work in xboard in many places, so ignore + strcpy( polyglotIniFile, iniDir ); +#endif } else { strcpy( polyglotIniFile, iniDir ); } - strcat( polyglotIniFile, "\\" ); + strcat( polyglotIniFile, SLASH_CHAR ); strcat( polyglotIniFile, iniFileName ); /* Create initialization file */