Fix Seirawan gating at Rook square in PGN castling moves
[xboard.git] / gtk / xboard.c
index 423f304..b9bfd32 100644 (file)
@@ -256,7 +256,6 @@ GtkAccelGroup *GtkAccelerators;
 typedef unsigned int BoardSize;
 BoardSize boardSize;
 Boolean chessProgram;
-int initialSquareSize;
 
 int  minX, minY; // [HGM] placement: volatile limits on upper-left corner
 int smallLayout = 0, tinyLayout = 0,
@@ -984,7 +983,9 @@ main (int argc, char **argv)
     }
 
     if ((chessDir = (char *) getenv("CHESSDIR")) == NULL) {
-       chessDir = ".";
+       static char dirName[MSG_SIZ];
+       getcwd(dirName, MSG_SIZ);
+       chessDir = dirName;
     } else {
        if (chdir(chessDir) != 0) {
            fprintf(stderr, _("%s: can't cd to CHESSDIR: "), programName);
@@ -2291,7 +2292,7 @@ InputSourceRef AddInputSource(pr, lineByLine, func, closure)
 
     channel = g_io_channel_unix_new(is->fd);
     g_io_channel_set_close_on_unref (channel, TRUE);
-    is->sid = g_io_add_watch(channel, G_IO_IN,(GIOFunc) DoInputCallback, is);
+    is->sid = g_io_add_watch(channel, G_IO_IN|G_IO_HUP,(GIOFunc) DoInputCallback, is);
 
     is->closure = closure;
     return (InputSourceRef) is;