summaryrefslogtreecommitdiffstats
path: root/adventure/hdr.h
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1999-02-10 00:11:28 +0000
committerhubertf <hubertf@NetBSD.org>1999-02-10 00:11:28 +0000
commit638c095d5cf47282d99189e1425435a0763a369b (patch)
tree6ec34cf92762fed9680f134cb5ab74869cf60f56 /adventure/hdr.h
parentf8df8c0281a2b93b58f947c4bc167c998f05e804 (diff)
downloadbsdgames-darwin-638c095d5cf47282d99189e1425435a0763a369b.tar.gz
bsdgames-darwin-638c095d5cf47282d99189e1425435a0763a369b.tar.zst
bsdgames-darwin-638c095d5cf47282d99189e1425435a0763a369b.zip
The game adventure(6) handles EOF on standard input rather
ungracefully. The patch, derived from OpenBSD, improves this handling. Sent in in PR 6556 by Joseph Myers <jsm28@cam.ac.uk>.
Diffstat (limited to 'adventure/hdr.h')
-rw-r--r--adventure/hdr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/adventure/hdr.h b/adventure/hdr.h
index fa47b6de..80ab5d61 100644
--- a/adventure/hdr.h
+++ b/adventure/hdr.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hdr.h,v 1.5 1998/08/29 20:19:56 hubertf Exp $ */
+/* $NetBSD: hdr.h,v 1.6 1999/02/10 00:11:28 hubertf Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -64,7 +64,7 @@ extern char data_file[]; /* Virtual data file */
#define TAB 011
#define LF 012
-#define FLUSHLINE while (getchar()!='\n')
+#define FLUSHLINE do { int flushline_ch; while ((flushline_ch = getchar()) != EOF && flushline_ch != '\n'); } while (0)
#define FLUSHLF while (next()!=LF)
int loc, newloc, oldloc, oldlc2, wzdark, gaveup, kq, k, k2;