Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: WARN_CREATE_GLOBAL and parameters used by the shell



On Fri, 20 Nov 2015 12:44:56 +0100
Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> I think that when WARN_CREATE_GLOBAL is set, one should get no warnings
> for parameters used by the shell, as their intent is to be global.

Yes, we need to ignore specials, which are already in the namespace
anyway.

pws

diff --git a/Src/params.c b/Src/params.c
index 3ed771e..b121bd6 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2702,7 +2702,7 @@ check_warn_create(Param pm, const char *pmtype)
     Funcstack i;
     const char *name;
 
-    if (pm->level != 0)
+    if (pm->level != 0 || (pm->node.flags & PM_SPECIAL))
 	return;
 
     name = NULL;



Messages sorted by: Reverse Date, Date, Thread, Author