Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Anybody objects to the following change in createparamtable()?



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