about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-02-14 17:54:42 -0800
committerBart Schaefer <schaefer@zsh.org>2023-02-14 17:54:42 -0800
commit32cceefa95903190829af26723b7ad51c163040c (patch)
tree08fb3d46e4ae86001181549988b0fb64256e916c /Src/params.c
parent7e0c4406ceba1e021bf37680d6a6b8dcd3dd657f (diff)
downloadzsh-32cceefa95903190829af26723b7ad51c163040c.tar.gz
zsh-32cceefa95903190829af26723b7ad51c163040c.tar.xz
zsh-32cceefa95903190829af26723b7ad51c163040c.zip
51437: Fix incorrectly-passed test case, masked by unrelated bug.
A bug with zmodload when unloading/reloading a static module caused the
state of the shell options to change during K01 test.  Worked around it.
Also changed warnnestedvar messages to look more like other such.
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Src/params.c b/Src/params.c
index 92cbecf63..e940d7995 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3068,7 +3068,7 @@ check_warn_pm(Param pm, const char *pmtype, int created,
     } else
 	return;
 
-    if (pm->node.flags & PM_SPECIAL)
+    if (pm->node.flags & (PM_SPECIAL|PM_NAMEREF))
 	return;
 
     for (i = funcstack; i; i = i->prev) {
@@ -6181,6 +6181,7 @@ setloopvar(char *name, char *value)
   if (pm && (pm->node.flags & PM_NAMEREF)) {
       pm->base = pm->width = 0;
       pm->u.str = ztrdup(value);
+      pm->node.flags &= ~PM_UNSET;
       pm->node.flags |= PM_NEWREF;
       setscope(pm);
       pm->node.flags &= ~PM_NEWREF;
@@ -6248,7 +6249,7 @@ setscope(Param pm)
 		      pm->node.nam);
 		unsetparam_pm(pm, 0, 1);
 	    } else if (isset(WARNNESTEDVAR))
-		zwarn("%s: global reference to local variable: %s",
+		zwarn("reference %s in enclosing scope set to local variable %s",
 		      pm->node.nam, pm->u.str);
 	}
 	if (pm->u.str && upscope(pm, pm->base) == pm &&