sh: Do not place exported but unset variables into the environment
PR: 233545 Submitted by: Jan Beich Obtained from: NetBSD
This commit is contained in:
parent
d3f4030708
commit
56f33d07ce
@ -558,13 +558,13 @@ environment(void)
|
||||
nenv = 0;
|
||||
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
|
||||
for (vp = *vpp ; vp ; vp = vp->next)
|
||||
if (vp->flags & VEXPORT)
|
||||
if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT)
|
||||
nenv++;
|
||||
}
|
||||
ep = env = stalloc((nenv + 1) * sizeof *env);
|
||||
for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) {
|
||||
for (vp = *vpp ; vp ; vp = vp->next)
|
||||
if (vp->flags & VEXPORT)
|
||||
if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT)
|
||||
*ep++ = vp->text;
|
||||
}
|
||||
*ep = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user