Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 1731 → Rev 1732

/svarcom/trunk/env.c
138,10 → 138,9
unsigned short envlen;
unsigned short vlen, veqpos;
char far *env = MK_FP(env_seg, 0);
char far *alreadyexists;
unsigned short alreadyexistslen;
 
/* remove variable from environment, if already set */
env_dropvar(env_seg, v);
 
/* compute v length and find the position of the eq sign */
veqpos = 0xffff;
for (vlen = 0; v[vlen] != 0; vlen++) {
151,15 → 150,28
}
}
 
/* if variable empty, stop here */
if (veqpos == vlen - 1) return(ENV_SUCCESS);
 
/* get length of the current environment */
envlen = env_getcurlen(env_seg);
 
/* does the variable already exist? */
alreadyexists = env_lookup(env_seg, v);
alreadyexistslen = 0;
if (alreadyexists != NULL) {
while (alreadyexists[alreadyexistslen] != 0) alreadyexistslen++;
}
 
/* do I have enough env space for the new var? */
if (envlen + vlen + 2 >= env_allocsz(env_seg)) return(ENV_NOTENOM);
if (envlen + vlen + 3 - alreadyexistslen >= env_allocsz(env_seg)) {
return(ENV_NOTENOM);
}
 
/* remove variable from environment if already set and recompute environment's length */
env_dropvar(env_seg, v);
envlen = env_getcurlen(env_seg);
 
/* if variable empty, stop here */
if (veqpos == vlen - 1) return(ENV_SUCCESS);
 
/* write the new variable (with its NULL terminator) to environment tail */
_fmemcpy(env + envlen, v, vlen + 1);
 
/svarcom/trunk/history.txt
3,9 → 3,7
=== SvarCOM's history / changelog ===
 
 
(ticket numbers at https://osdn.net/projects/svardos/ticket/ in [] brackets)
 
 
=== ver 2024.2 (xx.xx.2024) ==================================================
 
- DIR command: added /O support
14,6 → 12,7
reporting the issue and to ECM for locating the root cause.
ref: https://github.com/SvarDOS/bugz/issues/67
- implemented the internal LOADHIGH command
- SET command: failure to update an env variable does not delete the variable
 
 
=== ver 2024.1 (17.01.2024) ==================================================