X-Git-Url: http://winboard.nl/cgi-bin?p=uci2wb.git;a=blobdiff_plain;f=UCI2WB.c;h=73a55c6e1ad8cb411db1a3797b84d35378729e9a;hp=2971c3f5df7e00abec317f6574d387abb8c38c3c;hb=43e068c7ecc89ba411e518ad4f6bdcbed895f4cd;hpb=85a82d8e5887b236ac8c6bad257301b4d30b948d diff --git a/UCI2WB.c b/UCI2WB.c index 2971c3f..73a55c6 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -417,7 +417,7 @@ GUI2Engine() nomove: fflush(toE); fflush(stdout); i = 0; while((x = getchar()) != EOF && (line[i] = x) != '\n') i++; - line[++i] = 0; if(x == EOF) { printf("# EOF\n"); EPRINT((f, "# quit\n")) exit(-1); } + line[++i] = 0; if(x == EOF) { printf("# EOF\n"); sprintf(line, "quit -1\n"); } sscanf(line, "%s", command); if(!strcmp(command, "offer")) { drawOffer = 1; goto nomove; } // backlogged anyway, so this can be done instantly if(think) { // command arrived during thinking; order abort for 'instant commands' @@ -545,7 +545,7 @@ GUI2Engine() else if(!strcmp(command, "name")) { if(namOpt) EPRINT((f, "# setoption name UCI_Opponent value none none %s %s", comp ? "computer" : "human", line+5)) } else if(!strcmp(command, "computer")) comp = 1; else if(!strcmp(command, "result")) { if(sc == 's') EPRINT((f, "# gameover %s\n", line[8] == '/' ? "draw" : (line[7] == '0') == mySide ? "win" : "lose")) } - else if(!strcmp(command, "quit")) { EPRINT((f, "# quit\n")) fflush(toE), exit(0); } + else if(!strcmp(command, "quit")) { EPRINT((f, "# quit\n")) fflush(toE), exit(atoi(line+4)); } } }