commit 643d8f677a0554e323078b4d75171010dc5a612f
parent a19078db3265138bbd50200fbadeaec16b8a27ee
Author: tjg <tjg>
Date: Wed, 19 Apr 2000 14:16:51 +0000
2000-04-19
Bug: isatty() tests in input.c are relevant to any fd, not just 0.
Now `. -i /dev/tty' works right.
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git 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