diff options
| author | tjg <tjg> | 2000-04-19 14:16:51 +0000 |
|---|---|---|
| committer | Toby Goodwin <toby@paccrat.org> | 2015-05-16 21:23:17 +0100 |
| commit | 643d8f677a0554e323078b4d75171010dc5a612f (patch) | |
| tree | 3db4bdd0b19ffff7654c4d881c4b2943c13383cb /input.c | |
| parent | a19078db3265138bbd50200fbadeaec16b8a27ee (diff) | |
2000-04-19
Bug: isatty() tests in input.c are relevant to any fd, not just 0.
Now `. -i /dev/tty' works right.
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -94,7 +94,7 @@ static int fdgchar() { if (chars_out >= chars_in + 2) { /* has the buffer been exhausted? if so, replenish it */ while (1) { #if EDITLINE || READLINE - if (interactive && istack->fd == 0 && isatty(0)) { + if (interactive && istack->t == iFd && isatty(istack->fd)) { /* The readline library doesn't handle read() returning EAGAIN. */ makeblocking(istack->fd); rlinebuf = rc_readline(prompt); @@ -266,7 +266,7 @@ extern Node *doit(bool clobberexecit) { } if ((s = varlookup("prompt")) != NULL) { #if EDITLINE || READLINE - if (istack->t == iFd && istack->fd == 0 && isatty(0)) + if (istack->t == iFd && isatty(istack->fd)) prompt = s->w; else #endif @@ -353,7 +353,7 @@ extern void print_prompt2() { lineno++; if (interactive) { #if EDITLINE || READLINE - if (istack->t == iFd && istack->fd == 0 && isatty(0)) + if (istack->t == iFd && isatty(istack->fd)) prompt = prompt2; else #endif |