]>
Commit | Line | Data |
---|---|---|
517e249f | 1 | diff --git a/poldek_term.c b/poldek_term.c |
2 | index 2ee6b66..fec05de 100644 | |
3 | --- a/poldek_term.c | |
4 | +++ b/poldek_term.c | |
5 | @@ -287,6 +287,10 @@ int poldek_term_ask(int fd, const char *validchrs, const char *msg) | |
6 | if ((read(fd, &c, sizeof(c)) == 1) && strchr(validchrs, c)) | |
7 | break; | |
8 | ||
9 | + // terminal lost - so prevent loop | |
10 | + if (!isatty(fd)) | |
11 | + return 0; | |
12 | + | |
13 | if (msg) | |
14 | printf("%s\n", msg); | |
15 | } |