diff options
author | jsm <jsm@NetBSD.org> | 2000-09-21 09:49:03 +0000 |
---|---|---|
committer | jsm <jsm@NetBSD.org> | 2000-09-21 09:49:03 +0000 |
commit | 54fe46ad92fd6283ba380e0692db3d2e686ea6f4 (patch) | |
tree | f383cea2ecd666e8bd3c2c3121c710ab65b24bec | |
parent | 3ede983f24a9344b6caf3d9ac680df99aa916749 (diff) | |
download | bsdgames-darwin-54fe46ad92fd6283ba380e0692db3d2e686ea6f4.tar.gz bsdgames-darwin-54fe46ad92fd6283ba380e0692db3d2e686ea6f4.tar.zst bsdgames-darwin-54fe46ad92fd6283ba380e0692db3d2e686ea6f4.zip |
die() on EOF; based on OpenBSD.
-rw-r--r-- | battlestar/getcom.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/battlestar/getcom.c b/battlestar/getcom.c index 3f8f1306..4c7e2935 100644 --- a/battlestar/getcom.c +++ b/battlestar/getcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: getcom.c,v 1.7 2000/09/17 23:04:17 jsm Exp $ */ +/* $NetBSD: getcom.c,v 1.8 2000/09/21 09:49:03 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getcom.c,v 1.7 2000/09/17 23:04:17 jsm Exp $"); +__RCSID("$NetBSD: getcom.c,v 1.8 2000/09/21 09:49:03 jsm Exp $"); #endif #endif /* not lint */ @@ -53,6 +53,8 @@ getcom(buf, size, prompt, error) for (;;) { fputs(prompt, stdout); if (fgets(buf, size, stdin) == 0) { + if (feof(stdin)) + die(); clearerr(stdin); continue; } |