Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Anybody objects to the following change in createparamtable()?
- X-seq: zsh-workers 12399
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Anybody objects to the following change in createparamtable()?
- Date: Thu, 27 Jul 2000 12:12:29 +0400
- Importance: Normal
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
In createparamtable() (copy environment loop):
if ((!(pm = (Param) paramtab->getnode(paramtab, iname)) ||
!(pm->flags & PM_DONTIMPORT) && !(pm->flags & PM_EXPORTED)) &&
(pm = setsparam(iname, metafy(str + 1, -1, META_DUP)))) {
*str = '=';
pm->flags |= PM_EXPORTED;
....
The reason is, if we have duplicated environment entries, last one wins and
call to setsparam() will try to modify environment in the middle of traversing
it I'd prefer, if check for PM_EXPORTED comes first - if parameter is already
exported, just skip any environment with the same name.
At this point the only exported parameters are the ones resulted from
importing environment so it should be safe.
-andrej
Have a nice DOS!
B >>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author