aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/rc/input.c')
-rw-r--r--sys/cmd/rc/input.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/cmd/rc/input.c b/sys/cmd/rc/input.c
index cf05382..4c6b37f 100644
--- a/sys/cmd/rc/input.c
+++ b/sys/cmd/rc/input.c
@@ -85,7 +85,7 @@ enterraw(int fd)
{
struct termios raw;
- if(!isatty(0))
+ if(!shell.interactive)
goto fatal;
if(!mode.defer) {
@@ -995,7 +995,7 @@ notty(void)
for(;;){
c = fgetc(stdin);
- put(&shell->cmd.io, c);
+ put(&proc->cmd.io, c);
}
}
@@ -1019,17 +1019,17 @@ readline(char *prompt)
int n;
// reset the command buffer
- shell->cmd.io->e = shell->cmd.io->b = shell->cmd.io->buf;
+ proc->cmd.io->e = proc->cmd.io->b = proc->cmd.io->buf;
- if(!isatty(0))
+ if(!shell.interactive)
return notty();
- if((n = raw(shell->cmd.io->e, shell->cmd.io->cap-1, prompt)) == -1)
+ if((n = raw(proc->cmd.io->e, proc->cmd.io->cap-1, prompt)) == -1)
return 0;
- shell->cmd.io->e += n;
+ proc->cmd.io->e += n;
/* insert a newline character at the end */
- put(&shell->cmd.io, '\n');
+ put(&proc->cmd.io, '\n');
printf("\n");
return 1;