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

Re: Crash when exporting scalar without value and getsparam fails



On Sat, Jan 10, 2015 at 7:52 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Jan 9,  2:26pm, Mikael Magnusson wrote:
> } bug:
> }  unset IFS
> }  export IFS
> }
> } Would the non-gnu equivalent of addenv(pm, getsparam(pname) ?: ""); do
> } the trick here? Or should it just return with an error?
>
> I think it should do nothing to the environment and return success.
>
> % bash -c 'unset IFS; export IFS; echo $?; printenv | grep IFS'
> 0
> %
>
> However, we need an unset parameter object with the export flag set,
> so that it will become both set and exported when next a value is
> assigned to it.  I think that can be done but don't immediately
> recall how.

Ah yes, this is what happens for other parameters in zsh too.
% unset foo
% export foo
% printenv|grep foo
% foo=3
% printenv|grep foo
foo=3

-- 
Mikael Magnusson



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