An empty line (emitted by XBoard due to a bug) made HaChu repeat
the previous command. Now the GetLine routine keeps reading until
it gets a non-empty line.
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