From 76b3fe8ff878c1289de64f417f925afea3cb55e7 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 6 Jun 2015 14:55:24 +0100 Subject: [PATCH] ssh: fix $VARIABLE basics and notification on blank return --- Applications/util/ssh.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Applications/util/ssh.c b/Applications/util/ssh.c index eb6aa569..16b700c8 100644 --- a/Applications/util/ssh.c +++ b/Applications/util/ssh.c @@ -117,7 +117,8 @@ redo: argptr++; *argout++ = 0; if (subst) { - char *n = getenv(p); + /* Ought to wrap this and handle $? $$ $* and $1 $2 ... */ + char *n = getenv(p + 1); if (n) return n; else @@ -229,13 +230,14 @@ int main(int argc, char *argval[]) for (;;) { char **argp = arg; - pidwait(0, WNOHANG); for (i = 0; i < MAX_ARGS; i++) *argp++ = NULL; argp = arg; do { + pidwait(0, WNOHANG); + /* Also check for mail ?? */ if (infd == 0) write(1, cprompt, 5); if ((i = read(infd, buf, 127)) <= 0) { -- 2.34.1