diff options
author | Bart Schaefer <schaefer@ipost.com> | 2021-10-04 09:02:27 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@ipost.com> | 2021-10-04 09:02:27 -0700 |
commit | fa4c88ca25f587f52074698d4ff7eb263de07930 (patch) | |
tree | 24b6b556dd3900fc6253b51603850058efc50ab1 /Src/params.c | |
parent | 99d915330aa470e5ca723084f54910d82aec444d (diff) | |
download | zsh-fa4c88ca25f587f52074698d4ff7eb263de07930.tar.gz zsh-fa4c88ca25f587f52074698d4ff7eb263de07930.tar.xz zsh-fa4c88ca25f587f52074698d4ff7eb263de07930.zip |
49456: clean up detection of private params in nested scopes, update doc
Diffstat (limited to 'Src/params.c')
-rw-r--r-- | Src/params.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Src/params.c b/Src/params.c index 704aad588..b703a97ce 100644 --- a/Src/params.c +++ b/Src/params.c @@ -1013,6 +1013,11 @@ createparam(char *name, int flags) (oldpm->node.flags & PM_SPECIAL) || /* POSIXBUILTINS horror: we need to retain 'export' flags */ (isset(POSIXBUILTINS) && (oldpm->node.flags & PM_EXPORTED))) { + if (oldpm->node.flags & PM_RO_BY_DESIGN) { + zerr("%s: can't change parameter attribute", + name); + return NULL; + } oldpm->node.flags &= ~PM_UNSET; if ((oldpm->node.flags & PM_SPECIAL) && oldpm->ename) { Param altpm = |