zsh-workers
 help / color / mirror / code / Atom feed
* Anybody objects to the following change in createparamtable()?
@ 2000-07-27  8:12 Andrej Borsenkow
  2000-07-27  8:50 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Borsenkow @ 2000-07-27  8:12 UTC (permalink / raw)
  To: ZSH workers mailing list

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 >>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-07-27  9:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-27  8:12 Anybody objects to the following change in createparamtable()? Andrej Borsenkow
2000-07-27  8:50 ` Bart Schaefer
2000-07-27  9:13   ` Andrej Borsenkow

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).