X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=uci.cpp;h=35b84defe2e66ab3dd9de5e4fb872bb1ede39f92;hb=5eed4adb3552562329c0b0b460c8851efb1a38bb;hp=a84628ed7122a14d249c08f12cbe83e91e0c051b;hpb=e7a2abd9bd4fce9ebbd70793b00d9d5f99886348;p=polyglot.git diff --git a/uci.cpp b/uci.cpp index a84628e..35b84de 100644 --- a/uci.cpp +++ b/uci.cpp @@ -139,7 +139,7 @@ void uci_open(uci_t * uci, engine_t * engine) { do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); - } while ((event & EVENT_UCI) == 0); + } while (!engine_eof(Engine) && (event & EVENT_UCI) == 0); } // uci_close() @@ -223,7 +223,7 @@ void uci_send_isready_sync(uci_t * uci) { do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); - } while ((event & EVENT_READY) == 0); + } while (!engine_eof(Engine) && (event & EVENT_READY) == 0); } // uci_send_stop() @@ -258,7 +258,7 @@ void uci_send_stop_sync(uci_t * uci) { do { engine_get(uci->engine,string,StringSize); event = uci_parse(uci,string); - } while ((event & EVENT_STOP) == 0); + } while (!engine_eof(Engine) && (event & EVENT_STOP) == 0); } // uci_send_ucinewgame() @@ -805,6 +805,7 @@ static void parse_option(uci_t * uci, const char string[]) { uci->option_nb++; opt->value=NULL; + my_string_set(&opt->value,""); opt->mode=0; opt->name = NULL; @@ -847,6 +848,7 @@ static void parse_option(uci_t * uci, const char string[]) { if (!my_string_empty(argument)) { my_string_set(&opt->default_,argument); + my_string_set(&opt->value,argument); } } else if (my_string_equal(option,"max")) {