Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] builtin: trivial cleanup
- X-seq: zsh-workers 47546
- From: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] builtin: trivial cleanup
- Date: Thu, 12 Nov 2020 11:38:22 -0600
- Archived-at: <https://zsh.org/workers/47546>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/20201112173822.1500674-1-felipe.contreras%40gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f194.google.com) smtp.remote-ip=209.85.167.194; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Cc: Felipe Contreras <felipe.contreras@xxxxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rWYtBaKfJml0ElxnCcwGBKq4Wt5upknNBQ2Lj1M/0WU=; b=ZUlq5B5eazwIg/3oWYfPQJYvhY2NpQpvufkte5vX75mFZvjWrm9cOpxXy71ZskDqjR 8D9vU5qfBNZiNasjNEYKlpaKagBDf/7/Cqldr7hZkHbUdiSsYn60okKZQ8BH7X36tbuG Uq2VbsyHsv0NK7B3y6BPHPEkKiLlY//V0y2aUxevHEWVkaOD7ZtXy/P8N/o5zNx2J0xC rOgWyyoY56bBjRnWB96C+eD0P23wNKq/KiwMXFFL2InZul4Fz75XYEp7E+srhWmxemsW CTReusqdgnOdqi8LKZQ++TOsfIDfWiQ15CbwSvs5Yua8iSwTRAq1Movn9yGyXwGZT682 a3Qg==
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- Sender: zsh-workers-request@xxxxxxx
The flags were being set in exactly the same way in both branches of the
condition.
Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
Src/builtin.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/Src/builtin.c b/Src/builtin.c
index 09eb3728c..5d780e4ca 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2231,17 +2231,12 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func),
arrfixenv(pm->node.nam, x);
}
}
- 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;
--
2.29.2
Messages sorted by:
Reverse Date,
Date,
Thread,
Author