From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH 1/2] persistent locals - hidden references
Date: Tue, 5 Sep 2023 22:04:59 -0700 [thread overview]
Message-ID: <CAH+w=7aL5cK21gV4pzDBOKZgubVP45w=coXSdcC+t9dEmXzcig@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #2: hideval-nameref.txt --]
[-- Type: text/plain, Size: 838 bytes --]
diff --git a/Src/builtin.c b/Src/builtin.c
index 31af66c7c..01df7d73b 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2697,7 +2697,7 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func)
off |= bit;
}
if (OPT_MINUS(ops,'n')) {
- if ((on|off) & ~PM_READONLY) {
+ if ((on|off) & ~(PM_READONLY|PM_HIDEVAL)) {
zwarnnam(name, "no other attributes allowed with -n");
return 1;
}
diff --git a/Test/K01nameref.ztst b/Test/K01nameref.ztst
index d8c098a98..50224c32d 100644
--- a/Test/K01nameref.ztst
+++ b/Test/K01nameref.ztst
@@ -762,4 +762,9 @@ F:previously this could create an infinite recursion and crash
1:create nameref by pattern match not allowed
*?*typeset:1: invalid reference
+ typeset -nH foo=bar
+ typeset -p foo
+0:nameref with hidden value
+>typeset -n foo
+
%clean
reply other threads:[~2023-09-06 5:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAH+w=7aL5cK21gV4pzDBOKZgubVP45w=coXSdcC+t9dEmXzcig@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).