From 638c095d5cf47282d99189e1425435a0763a369b Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 10 Feb 1999 00:11:28 +0000 Subject: 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 . --- adventure/hdr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'adventure/hdr.h') 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; -- cgit v1.2.3-56-ge451