Only put PATH= in the environment if it's still empty just before

executing the shell. This repairs SET PATH=.... in config.sys without
confusing anyone.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@762 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2004-01-31 11:39:50 +00:00
parent 5567aba08b
commit 2b9e17a680
2 changed files with 4 additions and 2 deletions

View File

@ -137,8 +137,8 @@ UWORD ram_top = 0; /* How much ram in Kbytes */
static UBYTE ErrorAlreadyPrinted[128]; static UBYTE ErrorAlreadyPrinted[128];
char master_env[128] = {"PATH="}; /* some shells panic on empty master env. */ char master_env[128] = {0};
static char *envp = master_env + 6; /* point to the second zero */ static char *envp = master_env;
struct config Config = { struct config Config = {
0, 0,

View File

@ -364,6 +364,8 @@ STATIC void kernel()
int rc; int rc;
exb.exec.env_seg = DOS_PSP + 8; exb.exec.env_seg = DOS_PSP + 8;
if (master_env[0] == '\0') /* some shells panic on empty master env. */
strcpy(master_env, "PATH=.");
fmemcpy(MK_FP(exb.exec.env_seg, 0), master_env, sizeof(master_env)); fmemcpy(MK_FP(exb.exec.env_seg, 0), master_env, sizeof(master_env));
/* process 0 */ /* process 0 */