Fixed minor bug where a ^D at the terminal type prompt caused an infinite loop.
This commit is contained in:
parent
2e8c7ad45b
commit
8a763302fe
@ -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';
|
||||
|
Loading…
Reference in New Issue
Block a user