FUZIX: ssh.c: environment assignment bugfix + prettier prompting
authorBrett Gordon <beretta42@gmail.com>
Fri, 29 May 2015 15:36:21 +0000 (11:36 -0400)
committerAlan Cox <alan@linux.intel.com>
Sat, 30 May 2015 09:44:38 +0000 (10:44 +0100)
commitbae5b895f6c80dc25e605ba4e5a5e713572cb40a
treec7631feff8b45759083576d64cfc81f6dee4b1fd
parentf37e0b3929a7d0a7501775d99087560e727f9190
FUZIX: ssh.c: environment assignment bugfix + prettier prompting

here's a patch to ssh.c that:

1. Sets the prompt to include a space
2. Prints a newline in the output of the built-in "pwd"
3. Fixes environment variable assignment

As to no. 3:  The original code used "putenv()", which, on a new
variable, inserts the tmp char *  in to the env[] array.  "ssh"
proceeded to reuse this string for more input, thereby screwing up the
environment.  I changed it to "setenv()" which makes a new copy of the
string, then inserts it into env[].

This way at least us poor "ssh" users can set PATH until the real "sh"
and "init" are working better for the 6809.

--
Brett M. Gordon,
beretta42@gmail.com
Applications/util/ssh.c