summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--games/atc/graphics.c11
-rw-r--r--games/bs/bs.c7
-rw-r--r--games/robots/move.c5
-rw-r--r--games/rogue/inventory.c6
-rw-r--r--games/rogue/message.c5
5 files changed, 21 insertions, 13 deletions
diff --git a/games/atc/graphics.c b/games/atc/graphics.c
index 8d7d016a1e3..ccb7c60fc42 100644
--- a/games/atc/graphics.c
+++ b/games/atc/graphics.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $ */
+/* $OpenBSD: graphics.c,v 1.5 2000/07/23 22:23:37 pjanzen Exp $ */
/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
/*-
@@ -50,7 +50,7 @@
#if 0
static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: graphics.c,v 1.4 1999/09/01 00:27:07 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: graphics.c,v 1.5 2000/07/23 22:23:37 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -70,12 +70,13 @@ WINDOW *radar, *cleanradar, *credit, *input, *planes;
int
getAChar()
{
+ int c;
#ifdef BSD
- return (getchar());
+ if ((c = getchar()) == EOF && feof(stdin))
+ quit(0);
+ return (c);
#endif
#ifdef SYSV
- int c;
-
while ((c = getchar()) == -1 && errno == EINTR) ;
return(c);
#endif
diff --git a/games/bs/bs.c b/games/bs/bs.c
index 8fa73b3d873..dd8e88e980c 100644
--- a/games/bs/bs.c
+++ b/games/bs/bs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs.c,v 1.7 1998/03/12 09:03:49 pjanzen Exp $ */
+/* $OpenBSD: bs.c,v 1.8 2000/07/23 22:23:42 pjanzen Exp $ */
/*
* bs.c - original author: Bruce Holloway
* salvo option by: Chuck A DeGaul
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: bs.c,v 1.7 1998/03/12 09:03:49 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: bs.c,v 1.8 2000/07/23 22:23:42 pjanzen Exp $";
#endif
/* #define _POSIX_SOURCE */ /* (setegid, random) */
@@ -640,6 +640,9 @@ static int getcoord(int atcpu)
}
break;
#endif /* NCURSES_MOUSE_VERSION */
+ case ERR:
+ uninitgame(1);
+ break;
default:
if (atcpu)
(void) mvaddstr(CYBASE + BDEPTH + 1, CXBASE + 11, " ");
diff --git a/games/robots/move.c b/games/robots/move.c
index 664b49902d0..3ac87884d04 100644
--- a/games/robots/move.c
+++ b/games/robots/move.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: move.c,v 1.4 1999/12/18 11:18:12 pjanzen Exp $ */
+/* $OpenBSD: move.c,v 1.5 2000/07/23 22:23:42 pjanzen Exp $ */
/* $NetBSD: move.c,v 1.4 1995/04/22 10:08:58 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: move.c,v 1.4 1999/12/18 11:18:12 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: move.c,v 1.5 2000/07/23 22:23:42 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -203,6 +203,7 @@ teleport:
wrefresh(curscr);
break;
case EOF:
+ quit(0);
break;
default:
beep();
diff --git a/games/rogue/inventory.c b/games/rogue/inventory.c
index f31d6e5590a..2db81877a2b 100644
--- a/games/rogue/inventory.c
+++ b/games/rogue/inventory.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inventory.c,v 1.3 1998/08/22 08:55:28 pjanzen Exp $ */
+/* $OpenBSD: inventory.c,v 1.4 2000/07/23 22:23:42 pjanzen Exp $ */
/* $NetBSD: inventory.c,v 1.3 1995/04/22 10:27:35 cgd Exp $ */
/*
@@ -41,7 +41,7 @@
#if 0
static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: inventory.c,v 1.3 1998/08/22 08:55:28 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: inventory.c,v 1.4 2000/07/23 22:23:42 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -281,7 +281,7 @@ id_com()
message("Character you want help for (* for all):", 0);
refresh();
- ch = getchar();
+ ch = rgetchar();
switch(ch) {
case LIST:
diff --git a/games/rogue/message.c b/games/rogue/message.c
index 11ea4719e89..8d7137b54cb 100644
--- a/games/rogue/message.c
+++ b/games/rogue/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.4 1999/05/26 13:51:01 espie Exp $ */
+/* $OpenBSD: message.c,v 1.5 2000/07/23 22:23:42 pjanzen Exp $ */
/* $NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $ */
/*
@@ -216,6 +216,9 @@ rgetchar()
case '&':
save_screen();
break;
+ case EOF:
+ clean_up("");
+ break;
default:
return(ch);
}