Make resistant to empty lines
[hachu.git] / hachu.c
diff --git a/hachu.c b/hachu.c
index 79b7e67..bb26721 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -2792,8 +2792,10 @@ printf("# setup done");fflush(stdout);
       int i, c;\r
       while(1) {\r
         // wait for input, and read it until we have collected a complete line\r
-        for(i = 0; (inBuf[i] = c = getchar()) != '\n'; i++) if(c == EOF || i>7997) exit(0);\r
-        inBuf[i+1] = 0;\r
+        do {\r
+          for(i = 0; (inBuf[i] = c = getchar()) != '\n'; i++) if(c == EOF || i>7997) exit(0);\r
+          inBuf[i+1] = 0;\r
+        } while(!i); // ignore empty lines\r
 \r
         // extract the first word\r
         sscanf(inBuf, "%s", command);\r
@@ -3007,7 +3009,8 @@ pboard(board);
             }\r
          }\r
           if(currentVariant == V_WOLF)\r
-            printf("setup (PNBR...........WKpnbr...........wk) 8x8+0_fairy rnbwkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBWKBNR w 0 1\n");\r
+            printf("setup (PNBR......................WKpnbr......................wk) 8x8+0_fairy rnbwkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBWKBNR w 0 1\n"\r
+                   "piece W& K3cpafK\n");\r
           if(currentVariant == V_SHO)\r
             printf("setup (PNBRLSE..G.+++++++Kpnbrlse..g.+++++++k) 9x9+0_shogi lnsgkgsnl/1r2e2b1/ppppppppp/9/9/9/PPPPPPPPP/1B2E2R1/LNSGKGSNL w 0 1\n");\r
           if(currentVariant == V_WA)\r