X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=blobdiff_plain;f=uci.c;h=5eff8cce7f54ad93044d84addc39dabf3ed52e9b;hp=9326ec7b27951712d929602f2142b8f5e0343a97;hb=c6505b9bddf0ed2f461a473d4be40c98608d9866;hpb=bb6c47f77f59067c358579a71cefa1ae65180a30 diff --git a/uci.c b/uci.c index 9326ec7..5eff8cc 100644 --- a/uci.c +++ b/uci.c @@ -10,6 +10,7 @@ #include "board.h" #include "engine.h" +#include "gui.h" #include "move.h" #include "move_do.h" #include "move_legal.h" @@ -18,6 +19,7 @@ #include "line.h" #include "uci.h" + // constants static const bool UseDebug = FALSE; @@ -148,6 +150,11 @@ void uci_open(uci_t * uci, engine_t * engine) { do { engine_get(uci->engine,string); + // Handle the case that the engine is really a WB engine somewhat gracefully. + if((strstr(string,"Illegal") || strstr(string,"Error")) + &&strstr(string,"uci")){ + my_fatal("uci_open(): Not an UCI engine (not found).\n"); + } event = uci_parse(uci,string); } while (!engine_eof(Engine) && (event & EVENT_UCI) == 0); } @@ -331,7 +338,7 @@ int uci_parse(uci_t * uci, const char string[]) { parse_open(parse,string); if (parse_get_word(parse,command,StringSize)) { - + parse_get_string(parse,argument,StringSize); if (UseDebug) my_log("POLYGLOT COMMAND \"%s\" ARGUMENT \"%s\"\n",command,argument);