Regularly check for user input when searching, to have a chance to catch EOF from...
[gnushogi.git] / gnushogi / rawdsp.c
index 0aeeb35..d3f3055 100644 (file)
@@ -2,11 +2,14 @@
  * FILE: rawdsp.c
  *
  * ----------------------------------------------------------------------
- *
- * Copyright (c) 2012 Free Software Foundation
+ * Copyright (c) 1993, 1994, 1995 Matthias Mutz
+ * Copyright (c) 1999 Michael Vanier and the Free Software Foundation
  *
  * GNU SHOGI is based on GNU CHESS
  *
+ * Copyright (c) 1988, 1989, 1990 John Stanback
+ * Copyright (c) 1992 Free Software Foundation
+ *
  * This file is part of GNU SHOGI.
  *
  * GNU Shogi is free software; you can redistribute it and/or modify it
@@ -201,6 +204,8 @@ Raw_ExitShogi(void)
 
     if (!nolist)
         ListGame();
+
+    exit(0);
 }
 
 
@@ -311,7 +316,8 @@ Raw_help(void)
            TimeControl.moves[black], TimeControl.clock[black] / 100,
            TCadd/100, MaxSearchDepth);
 
-    signal(SIGUSR1, Raw_TerminateSearch);
+    signal(SIGINT, Raw_TerminateSearch);
+    signal(SIGQUIT, Raw_TerminateSearch);
 }
 
 
@@ -378,8 +384,8 @@ Raw_EditBoard(void)
         }
         else
         {
-            c = '9' - s[1];
-            r = 'i' - s[2];
+            c = COL_NAME(s[1]);
+            r = ROW_NAME(s[2]);
         }
 
         if ((c >= 0) && (c < NO_COLS) && (r >= 0) && (r < NO_ROWS))
@@ -483,7 +489,8 @@ SetupBoard(void)
 void
 Raw_SearchStartStuff(short side)
 {
-    signal(SIGUSR1, Raw_TerminateSearch);
+    signal(SIGINT, Raw_TerminateSearch);
+    signal(SIGQUIT, Raw_TerminateSearch);
 
     if (flag.post)
     {