Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug Report: Env Vars and shell functions
- X-seq: zsh-workers 1596
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: pws@xxxxxx (Peter Stephenson)
- Subject: Re: Bug Report: Env Vars and shell functions
- Date: Wed, 10 Jul 1996 04:33:47 +0200 (MET DST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199607081249.OAA09298@xxxxxxxxxxxx> from Peter Stephenson at "Jul 8, 96 02:49:18 pm"
There is still a bug here:
% bug () { : }
% export FOO=foo
% FOO=bar bug
% printenv FOO
bar
The patch below hepefully fixes that.
Zoltan
*** Src/exec.c 1996/07/10 02:15:42 2.55
--- Src/exec.c 1996/07/10 02:15:50
***************
*** 1696,1701 ****
--- 1696,1706 ----
paramtab->removenode(paramtab, s);
addlinknode(*remove_p, s);
addlinknode(*restore_p, pm);
+ if ((pm->flags & PM_EXPORTED) && pm->env) {
+ delenv(pm->env);
+ zsfree(pm->env);
+ pm->env = NULL;
+ }
}
} else {
addlinknode(*remove_p, s);
***************
*** 1721,1728 ****
if (restorelist) {
/* restore saved parameters */
! while ((pm = (Param) getlinknode(restorelist)))
paramtab->addnode(paramtab, pm->nam, pm);
freelinklist(restorelist, 0);
}
}
--- 1726,1736 ----
if (restorelist) {
/* restore saved parameters */
! while ((pm = (Param) getlinknode(restorelist))) {
paramtab->addnode(paramtab, pm->nam, pm);
+ if (pm->flags & PM_EXPORTED)
+ pm->env = addenv(pm->nam, getsparam(pm->nam));
+ }
freelinklist(restorelist, 0);
}
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author