diff options
| author | Felipe Contreras <felipe.contreras@gmail.com> | 2020-11-12 11:38:22 -0600 |
|---|---|---|
| committer | Oliver Kiddle <opk@zsh.org> | 2026-06-23 02:15:14 +0200 |
| commit | 334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9 (patch) | |
| tree | 4c1e550d60e27ba3e54325463e25df87fb1b01ed | |
| parent | 54844: complete variable assignments with configure (diff) | |
| download | zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar.gz zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar.bz2 zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar.lz zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar.xz zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.tar.zst zsh-334cf2b707a91bcdd7109cf91e847e3ec6c7d3e9.zip | |
47546: builtin: trivial cleanup
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | Src/builtin.c | 17 |
2 files changed, 8 insertions, 11 deletions
@@ -1,5 +1,7 @@ 2026-06-23 Oliver Kiddle <opk@zsh.org> + * Felipe Contreras: 47546: Src/builtin.c: trivial cleanup + * 54844: Completion/Unix/Command/_configure, Completion/Unix/Command/_gcc: complete variable assignments with configure diff --git a/Src/builtin.c b/Src/builtin.c index e06581db4..f1d0b606f 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2276,17 +2276,12 @@ typeset_single(char *cname, char *pname, Param pm, int func, paramtab->printnode(&pm->node, PRINT_TYPESET|PRINT_WITH_NAMESPACE); return pm; } - if (usepm == 2) /* do not change the PM_UNSET flag */ - pm->node.flags = (pm->node.flags | (on & ~PM_READONLY)) & ~off; - else { - /* - * Keep unset if using readonly in POSIX mode. - */ - if (!(on & PM_READONLY) || !isset(POSIXBUILTINS)) - off |= PM_UNSET; - pm->node.flags = (pm->node.flags | - (on & ~PM_READONLY)) & ~off; - } + /* + * Keep unset if using readonly in POSIX mode unless specified otherwise. + */ + if ((usepm != 2) && !((on & PM_READONLY) && isset(POSIXBUILTINS))) + off |= PM_UNSET; + pm->node.flags = (pm->node.flags | (on & ~PM_READONLY)) & ~off; if (on & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) { if (typeset_setwidth(cname, pm, ops, on, 0)) return NULL; |
