X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=proce.c;h=8556ef1fee060e7c3ceac0a241e2ad027f181058;hb=b1a30f159e4ba24e00a43c79f71a334e5206d8ad;hp=a17a5de5960a840cb52a43c0a4747fcd92477d4e;hpb=e6a997890d6b8163efd00f50fc651b4340f1d68f;p=bonanza.git diff --git a/proce.c b/proce.c index a17a5de..8556ef1 100644 --- a/proce.c +++ b/proce.c @@ -109,6 +109,24 @@ int CONV is_move( const char *str ) } +#if defined(_WIN32) +char * +strtok_r( char *s, const char *t, char **next) +{ + char *p, *r; + if( ! s ) s = *next; + if( ! s ) return NULL; + while( *s && strchr(t, *s) ) s++; + if( ! *s ) return NULL; + r = s; + while( *s && ! (p = strchr(t, *s)) ) s++; + *next = s + 1; + if( ! *s ) *next = NULL; + *s = '\0'; + return r; +} +#endif + int CONV procedure( tree_t * restrict ptree ) { @@ -304,7 +322,7 @@ Out("# command = '%s'\n", line); IF("analyze") { return 0; } IF("exit") { return 0; } IF("variant") { /* ignore, since it must be Shogi */; } - IF("setboard") { forceMode = plyNr = 0; read_fen( line ); return 0; } + IF("setboard") { forceMode = 1; plyNr = 0; read_fen( line ); return 0; } IF("option") { if(sscanf(line+7, "MultiPV=%d", &value) == 1) { sprintf(line, "mpv num %d", value); return 0; } if(sscanf(line+7, "centi-Pawn margin=%d", &value) == 1) { sprintf(line, "mpv width %d", value); return 0; }