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

Re: Builtin strftime and TZ assignments



On Feb 21, 10:27pm, Peter Stephenson wrote:
} Subject: Re: Builtin strftime and TZ assignments
}
} On Sat, 21 Feb 2015 12:45:46 -0800
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > However, I'm hoping someone (PWS?) can explain why the extra pm->level
} > bump is necessary to get the parameter to be removed from the environment
} > upon endparamscope().
} 
} I don't know.  Is it necessary?

Without it, starting from an unset TZ, doing

torch% TZ=UTC strftime ...

results in TZ remaining set to UTC after strftime completes.  With the
pm->level bump, TZ is back to unset again after strftime completes.

} The code in params.c that deals with
} locallevel suggests it shouldn't be.

If I skip the createparam() [necessary for PM_EXPORT] and instead just
setsparam(), then the parameter is properly removed from scope as I
would expect, but of course then strptime() doesn't work as desired.
So it has something to do with export?

I briefly considered adding an ASSPM_EXPORTED flag and changing the
behavior of assignstrvalue() in params.c, but decided against it.



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