diff options
author | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-04-08 12:22:40 +0000 |
---|---|---|
committer | Paul Janzen <pjanzen@cvs.openbsd.org> | 2000-04-08 12:22:40 +0000 |
commit | 180d1445e8ba7c1e19b8a7a90470bdd8a7716b22 (patch) | |
tree | c3f7c51ff0e68b1936cd4775be50efce225d852c /games | |
parent | bb12808601d21c68ae66cd70fdf72b758890268c (diff) |
Handle EOF more cleanly
Diffstat (limited to 'games')
-rw-r--r-- | games/fish/fish.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/games/fish/fish.c b/games/fish/fish.c index d65c0c6af54..4408530dc0c 100644 --- a/games/fish/fish.c +++ b/games/fish/fish.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fish.c,v 1.7 2000/04/08 12:18:25 pjanzen Exp $ */ +/* $OpenBSD: fish.c,v 1.8 2000/04/08 12:22:39 pjanzen Exp $ */ /* $NetBSD: fish.c,v 1.3 1995/03/23 08:28:18 cgd Exp $ */ /*- @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)fish.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$OpenBSD: fish.c,v 1.7 2000/04/08 12:18:25 pjanzen Exp $"; +static char rcsid[] = "$OpenBSD: fish.c,v 1.8 2000/04/08 12:22:39 pjanzen Exp $"; #endif #endif /* not lint */ @@ -466,8 +466,10 @@ getans(prompt) for (;;) { (void)printf("%s", prompt); (void)fflush(stdout); - if (!fgets(buf, sizeof(buf), stdin)) - return(0); + if (!fgets(buf, sizeof(buf), stdin)) { + (void)printf("\n"); + exit(0); + } if (*buf == 'N' || *buf == 'n') return(0); if (*buf == 'Y' || *buf == 'y') |