summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2017-09-23 19:23:53 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2017-09-25 20:03:05 +0100
commit7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a (patch)
tree33b8aade0a993399a1bd67089a86a042862eaa31 /Src/subst.c
parent9cab4c3d7f098e0ca48083c2e4714fab812c5b39 (diff)
downloadzsh-7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a.tar.gz
zsh-7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a.tar.xz
zsh-7d4b41b52aeabb6f6f95f9bdfdab96b5fd66909a.zip
41747: Don't create hash entry if just checking existence.
Pass a flag in indicating this case.
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 357dc9168..55b5444c6 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2446,7 +2446,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
      */
     if (!subexp || aspar) {
 	char *ov = val;
-
+	int scanflags = hkeys | hvals;
+	if (arrasg)
+	    scanflags |= SCANPM_ASSIGNING;
+	if (qt)
+	    scanflags |= SCANPM_DQUOTED;
+	if (chkset)
+	    scanflags |= SCANPM_CHECKING;
 	/*
 	 * Second argument: decide whether to use the subexpression or
 	 *   the string next on the line as the parameter name.
@@ -2475,9 +2481,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags,
 	if (!(v = fetchvalue(&vbuf, (subexp ? &ov : &s),
 			     (wantt ? -1 :
 			      ((unset(KSHARRAYS) || inbrace) ? 1 : -1)),
-			     hkeys|hvals|
-			     (arrasg ? SCANPM_ASSIGNING : 0)|
-			     (qt ? SCANPM_DQUOTED : 0))) ||
+			     scanflags)) ||
 	    (v->pm && (v->pm->node.flags & PM_UNSET)) ||
 	    (v->flags & VALFLAG_EMPTY))
 	    vunset = 1;