Add forgotten files 1.4.70b
[polyglot.git] / uci.cpp
diff --git a/uci.cpp b/uci.cpp
index a84628e..35b84de 100644 (file)
--- a/uci.cpp
+++ b/uci.cpp
@@ -139,7 +139,7 @@ void uci_open(uci_t * uci, engine_t * engine) {
    do {\r
       engine_get(uci->engine,string,StringSize);\r
       event = uci_parse(uci,string);\r
-   } while ((event & EVENT_UCI) == 0);\r
+   } while (!engine_eof(Engine) && (event & EVENT_UCI) == 0);\r
 }\r
 \r
 // uci_close()\r
@@ -223,7 +223,7 @@ void uci_send_isready_sync(uci_t * uci) {
    do {\r
       engine_get(uci->engine,string,StringSize);\r
       event = uci_parse(uci,string);\r
-   } while ((event & EVENT_READY) == 0);\r
+   } while (!engine_eof(Engine) && (event & EVENT_READY) == 0);\r
 }\r
 \r
 // uci_send_stop()\r
@@ -258,7 +258,7 @@ void uci_send_stop_sync(uci_t * uci) {
    do {\r
       engine_get(uci->engine,string,StringSize);\r
       event = uci_parse(uci,string);\r
-   } while ((event & EVENT_STOP) == 0);\r
+   } while (!engine_eof(Engine) && (event & EVENT_STOP) == 0);\r
 }\r
 \r
 // uci_send_ucinewgame()\r
@@ -805,6 +805,7 @@ static void parse_option(uci_t * uci, const char string[]) {
    uci->option_nb++;\r
 \r
    opt->value=NULL;\r
+   my_string_set(&opt->value,"<empty>");\r
    opt->mode=0;\r
 \r
    opt->name = NULL;\r
@@ -847,6 +848,7 @@ static void parse_option(uci_t * uci, const char string[]) {
 \r
          if (!my_string_empty(argument)) {\r
             my_string_set(&opt->default_,argument);\r
+            my_string_set(&opt->value,argument);\r
          }\r
 \r
       } else if (my_string_equal(option,"max")) {\r