From d9d31322aa799e4dddf2e041e40e52fae9af94eb Mon Sep 17 00:00:00 2001 From: Luchezar Georgiev Date: Thu, 23 Sep 2004 07:43:17 +0000 Subject: [PATCH] Fix SET PATH=xxx in CONFIG.SYS git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1053 6ac86273-5f31-0410-b378-82cca8765d1b --- docs/history.txt | 3 ++- kernel/config.c | 9 +++++++-- kernel/main.c | 6 ------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/history.txt b/docs/history.txt index a36d68d..d817c00 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -311,7 +311,7 @@ * break.c: check_handle_break() return was undefined if no Ctrl-break * config.sys: all commands removed as they were close to defaults * contrib.txt: added Aitor Santamaria, Bernd Blaauw and Eduardo Casino - * country.asm / country.sys support now replaces hard-coded data + * country.asm / config.c: COUNTRY.SYS now replaces hard-coded data * 11 countries added to country.asm: GR,RO,AT,MA,SG,KR,CN,TR,IN,M.E,IL * dosnames.c: macro to function conversion, optimisation and clean-up * dyninit.c: excluded unused DynFree(), "what" passed only on DEBUG @@ -336,6 +336,7 @@ - InitializeAllBPBs() kludge removed (no longer needed - verified) - revision sequence now initialised along with DOS version in LoL - CheckContinueBootFromHardDisk() function code and text cleaned up + - "PATH=." now static in config.c ->SET PATH=xxx in CONFIG.SYS works * makefile: object files reordered to gain ~300B packed size * newstuff.c, fatdir.c, blockio.c, chario.c, prf.c: cleanup & optimise * portab.h: pragma aux default to gain ~800B unpacked size (Watcom) diff --git a/kernel/config.c b/kernel/config.c index f3407fc..1ab5319 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -2110,8 +2110,13 @@ VOID DoInstall(void) /* master_env copied over command line area in DOS_PSP, thus its size limited to 128 bytes */ -static char master_env[128] BSS_INIT({0}); -static PStr envp = master_env; +static char master_env[128] = "PATH=."; + + /* !!! dirty hack: because bug in old FreeCOM, which wrongly + process empty environment in MS-DOS style, garbage empty + environment by dummy variable: --avb + */ +static PStr envp = master_env + 7; /* sizeof("PATH=.") + 1 zero */ /* Format: SET var = string */ STATIC void CmdSet(PCStr p) diff --git a/kernel/main.c b/kernel/main.c index bd54324..714354e 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -175,12 +175,6 @@ STATIC void PSPInit(void) /* this area reused for master environment */ /*p->ps_cmd.ctCount = 0;*/ /* local command line */ /*p->ps_cmd.ctBuffer[0] = '\r';*/ /* command tail */ - - /* !!! dirty hack: because bug in old FreeCOM, which wrongly - process empty environment in MS-DOS style, garbage empty - environment by dummy variable: --avb - */ - fmemcpy(&p->ps_cmd, "PATH=.", 6/*strlen("PATH=.")*/); } #ifndef __WATCOMC__