From e432a8078374b509af58931b40177354e4ce2f09 Mon Sep 17 00:00:00 2001 From: deraadt Date: Thu, 15 Jan 2015 17:13:37 +0000 Subject: [PATCH] NR_OF_EOFS is a festering boil, lance & drain. ok millert --- games/hack/hack.tty.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/games/hack/hack.tty.c b/games/hack/hack.tty.c index 6c8765057af..a4386b048f2 100644 --- a/games/hack/hack.tty.c +++ b/games/hack/hack.tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.tty.c,v 1.11 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.tty.c,v 1.12 2015/01/15 17:13:37 deraadt Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -100,14 +100,6 @@ #include #include -/* - * Some systems may have getchar() return EOF for various reasons, and - * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs. - */ -#ifndef BSD -#define NR_OF_EOFS 20 -#endif /* BSD */ - static char erase_char, kill_char; static boolean settty_needed = FALSE; struct termios inittyb, curttyb; @@ -330,23 +322,7 @@ readchar() (void) fflush(stdout); if((sym = getchar()) == EOF) -#ifdef NR_OF_EOFS - { /* - * Some SYSV systems seem to return EOFs for various reasons - * (?like when one hits break or for interrupted systemcalls?), - * and we must see several before we quit. - */ - int cnt = NR_OF_EOFS; - while (cnt--) { - clearerr(stdin); /* omit if clearerr is undefined */ - if((sym = getchar()) != EOF) goto noteof; - } - end_of_input(); - noteof: ; - } -#else end_of_input(); -#endif /* NR_OF_EOFS */ if(flags.toplin == 1) flags.toplin = 2; return((char) sym); -- 2.20.1