From: Alan Cox Date: Sat, 6 Jun 2015 13:55:24 +0000 (+0100) Subject: ssh: fix $VARIABLE basics and notification on blank return X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=76b3fe8ff878c1289de64f417f925afea3cb55e7;p=FUZIX.git ssh: fix $VARIABLE basics and notification on blank return --- 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) {