Regularly check for user input when searching, to have a chance to catch EOF from...
[gnushogi.git] / gnushogi / commondsp.c
index db90fd3..1f39b78 100644 (file)
@@ -1745,8 +1745,8 @@ InputCommand(char *command)
             {
                 s[0] = sx[0] = '\0';
 
-                while(!sx[0])
-                    (void)fgets(sx, 80, stdin);
+                while(!eof && !sx[0])
+                    eof = (fgets(sx, 80, stdin) == NULL);
             }
             else
             {
@@ -2162,7 +2162,7 @@ InputCommand(char *command)
 #endif
     }
 
-    signal(SIGUSR1, TerminateSearch);
+    signal(SIGINT, TerminateSearch);
 }