mirror of https://github.com/FDOS/kernel.git
config: pass searchvar result to deletevar
This commit is contained in:
parent
24d19cd05c
commit
6101fb2aed
|
@ -2751,9 +2751,8 @@ STATIC BYTE far * searchvar(const BYTE * name, int length)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
STATIC void deletevar(const BYTE * name, int length) {
|
||||
STATIC void deletevar(BYTE far * pp) {
|
||||
int variablelength;
|
||||
BYTE far * pp = searchvar(name, length);
|
||||
if (NULL == pp)
|
||||
return;
|
||||
variablelength = fstrlen(pp) + 1;
|
||||
|
@ -2770,10 +2769,12 @@ STATIC VOID CmdSet(BYTE *pLine)
|
|||
if (*pLine == '=') /* equal sign is required */
|
||||
{
|
||||
int size, namesize;
|
||||
BYTE far * pp;
|
||||
strupr(szBuf); /* all environment variables must be uppercase */
|
||||
namesize = strlen(szBuf);
|
||||
strcat(szBuf, "=");
|
||||
deletevar(szBuf, namesize);
|
||||
pp = searchvar(szBuf, namesize);
|
||||
deletevar(pp);
|
||||
pLine = skipwh(++pLine);
|
||||
strcat(szBuf, pLine); /* append the variable value (may include spaces) */
|
||||
size = strlen(szBuf);
|
||||
|
|
Loading…
Reference in New Issue