mirror of
https://github.com/FDOS/kernel.git
synced 2025-07-24 06:14:29 +02:00
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC void deletevar(const BYTE * name, int length) {
|
STATIC void deletevar(BYTE far * pp) {
|
||||||
int variablelength;
|
int variablelength;
|
||||||
BYTE far * pp = searchvar(name, length);
|
|
||||||
if (NULL == pp)
|
if (NULL == pp)
|
||||||
return;
|
return;
|
||||||
variablelength = fstrlen(pp) + 1;
|
variablelength = fstrlen(pp) + 1;
|
||||||
@ -2770,10 +2769,12 @@ STATIC VOID CmdSet(BYTE *pLine)
|
|||||||
if (*pLine == '=') /* equal sign is required */
|
if (*pLine == '=') /* equal sign is required */
|
||||||
{
|
{
|
||||||
int size, namesize;
|
int size, namesize;
|
||||||
|
BYTE far * pp;
|
||||||
strupr(szBuf); /* all environment variables must be uppercase */
|
strupr(szBuf); /* all environment variables must be uppercase */
|
||||||
namesize = strlen(szBuf);
|
namesize = strlen(szBuf);
|
||||||
strcat(szBuf, "=");
|
strcat(szBuf, "=");
|
||||||
deletevar(szBuf, namesize);
|
pp = searchvar(szBuf, namesize);
|
||||||
|
deletevar(pp);
|
||||||
pLine = skipwh(++pLine);
|
pLine = skipwh(++pLine);
|
||||||
strcat(szBuf, pLine); /* append the variable value (may include spaces) */
|
strcat(szBuf, pLine); /* append the variable value (may include spaces) */
|
||||||
size = strlen(szBuf);
|
size = strlen(szBuf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user