Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Regression of typeset output with "private"
- X-seq: zsh-workers 52554
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Regression of typeset output with "private"
- Date: Fri, 16 Feb 2024 22:29:10 -0800
- Archived-at: <https://zsh.org/workers/52554>
- In-reply-to: <CAH+w=7YVBsN-4-TJaTVzzexyEmBq_1pp810TYe_faZPNVmw5wg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YVBsN-4-TJaTVzzexyEmBq_1pp810TYe_faZPNVmw5wg@mail.gmail.com>
On Fri, Feb 16, 2024 at 12:09 PM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> Tangentially, I think there's a regression with "private":
>
> () {
> zmodload zsh/param/private
> private foo=local
> typeset -p foo
> }
>
> That now prints nothing, whereas in e.g. 5.7 it would say
> typeset foo=local
> which isn't precisely accurate either.
Traced this to here:
>> commit f99f7dca7552d21782354f675c0741896c9785f1
>> Author: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
>> Date: Mon Oct 8 10:10:42 2018 +0100
>>
>> 43616: Various parameter setting and display fixes.
Specifically to this (pardon any excessive gmail line wrapping):
- if (printflags & PRINT_TYPESET) {
- if ((p->node.flags & (PM_READONLY|PM_SPECIAL)) ==
- (PM_READONLY|PM_SPECIAL) ||
- (p->node.flags & PM_AUTOLOAD)) {
+ if (printflags & (PRINT_TYPESET|PRINT_POSIX_READONLY|PRINT_POSIX_EXPORT)) {
+ if (p->node.flags & (PM_RO_BY_DESIGN|PM_AUTOLOAD)) {
/*
* It's not possible to restore the state of
* these, so don't output.
*/
return;
}
Leaving out PM_RO_BY_DESIGN restores the old behavior. I understand
the motivation here (the comment), and if we were printing all values
("typeset -p" with no other arguments) it would make more sense, but
in the context of explicitly asking for "typeset -p foo" it surely
ought to print ... something?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author