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

Re: Crash when exporting scalar without value and getsparam fails

On Jan 10,  8:10pm, Mikael Magnusson wrote:
} % unset IFS
} % export IFS
} % IFS=5
} % unset IFS
} % printenv|grep IFS # this would be empty for a normal parameter
} IFS=5

OK, so the remaining issue is that the PM_EXPORT flag is not cleared
when a special parameter is unset.

I think this is within the definition of how a special paramter behaves;
i.e., it retains all its attributes even when unset.  In this case we
have an attribute that's not normally "part of the specialness" of the
parameter, which is also being preserved.  The same thing happens with
other flags on other specials, e.g.:

torch% print $SECONDS
torch% typeset -E SECONDS
torch% print $SECONDS    
torch% unset SECONDS
torch% print $SECONDS

torch% SECONDS=763
torch% print $SECONDS

So should e.g. stdunsetfn() and tiedarrunsetfn() clear the PM_EXPORTED
flag as well as assert the PM_UNSET flag?  Or is that going to cause a
problem elsewhere because there is a special parameter that has the
feature of always being exported?  I can't think of any, but maybe we
shouldn't rule it out ... in which case this gets really hairy, as we
will have to know, for every special, what flags should or should not
be retained across unset.

Messages sorted by: Reverse Date, Date, Thread, Author