From: Brett Gordon Date: Sun, 24 May 2015 15:23:28 +0000 (-0400) Subject: fuzix ssh bugfix X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=850fe1970f024af0318d41feea240a3729b44c6c;p=FUZIX.git fuzix ssh bugfix I've improved "ssh" for now until "sh" is working for the 6809 platforms. This patch for "ssh" fixed two things: * cd to user's home directory on login invocation * a cd without arguments works --- diff --git a/Applications/util/ssh.c b/Applications/util/ssh.c index d4d912af..99c14179 100644 --- a/Applications/util/ssh.c +++ b/Applications/util/ssh.c @@ -66,7 +66,7 @@ int main(int argc, char *argval[]) if (login_sh) { home = getenv("HOME"); if (!home) putenv("HOME=/"); - chdir("/"); + chdir(getenv("HOME")); } cprompt = (getuid() == 0) ? "ssh#" : "ssh$"; @@ -90,7 +90,7 @@ int main(int argc, char *argval[]) /* Check for User request to change Current Working Directory */ else if (strcmp(cmd, "cd") == 0) { - stat = chdir(*arg[0] ? arg[0] : getenv("HOME")); + stat = chdir(arg[0] ? arg[0] : getenv("HOME")); if (stat) perror("cd"); }