X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;h=0e7f34f0fe7bea3bafa54ca4e62162d7484cc9e9;hp=4cbf5a87819667a4b3e66be87e2e24f96c6a9be0;hb=0bcc18ddfe1e849b345a565850e2a14cdab30d1a;hpb=f9b3d49480bbbf3200dde21ca58dcd5ae41bcfa1 diff --git a/UCI2WB.c b/UCI2WB.c index 4cbf5a8..0e7f34f 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -436,8 +436,9 @@ Move4Engine(char *m) } } -int DoCommand (char *line); +int DoCommand (); char mySide; +char queue[10000], *qStart, *qEnd; void GUI2Engine() @@ -532,16 +533,19 @@ GUI2Engine() !strcmp(command, "force") || !strcmp(command, "result")) { EPRINT((f, "# stop\n")); fflush(toE); } Sync(PAUSE); Release(); // block processing of difficult commands during thinking; send backlog left because of race } - if(DoCommand(line)) goto nomove; + if(qStart == qEnd) qStart = qEnd = queue; + p = line; while(qEnd < queue+10000 && (*qEnd++ = *p++) != '\n') {} + if(DoCommand()) goto nomove; } } int -DoCommand (char *line) +DoCommand () { - char command[256], *p, *q, *r, type[99]; + char line[1024], command[256], *p, *q, *r, type[99]; int i; + p=line; while(qStart < qEnd && (*p++ = *qStart++) != '\n') {} *p = 0; sscanf(line, "%s", command); if(!strcmp(command, "new")) {