From 643d8f677a0554e323078b4d75171010dc5a612f Mon Sep 17 00:00:00 2001 From: tjg Date: Wed, 19 Apr 2000 14:16:51 +0000 Subject: 2000-04-19 Bug: isatty() tests in input.c are relevant to any fd, not just 0. Now `. -i /dev/tty' works right. --- input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input.c b/input.c index 8daa6e2..f59f29e 100644 --- a/input.c +++ b/input.c @@ -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 -- cgit v1.2.3