Fixed minor bug where a ^D at the terminal type prompt caused an infinite loop.

This commit is contained in:
proven 1993-04-09 21:36:14 +00:00
parent 2e8c7ad45b
commit 8a763302fe

View File

@ -128,8 +128,11 @@ askuser(dflt)
(void)fprintf(stderr, "Terminal type? ");
(void)fflush(stderr);
if (fgets(answer, sizeof(answer), stdin) == NULL)
if (fgets(answer, sizeof(answer), stdin) == NULL) {
if (feof(stdin))
clearerr(stdin);
continue;
}
if (p = index(answer, '\n'))
*p = '\0';