diff options
Diffstat (limited to 'tis-as.c')
| -rw-r--r-- | tis-as.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -50,13 +50,14 @@ main(int argc, const char **argv) tis.stdin_port.out = -1; idle = false; - while (!idle || !prev_idle || tis.stdin_port.reading && !feof(tis_stdin)) { - if (tis.stdin_port.out < 0) { + while (!idle || !prev_idle || tis.stdin_port.attached + && tis.stdin_port.reading && !feof(tis_stdin)) { + if (tis.stdin_port.attached && tis.stdin_port.out < 0) { c = getc(tis_stdin); if (c >= 0) tis.stdin_port.out = c; } - if (tis.stdout_port.in >= 0) { + if (tis.stdout_port.attached && tis.stdout_port.in >= 0) { putc(tis.stdout_port.in, tis_stdout); tis.stdout_port.in = -1; } |
