about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2002-01-27 18:21:21 +0000
committerBart Schaefer <barts@users.sourceforge.net>2002-01-27 18:21:21 +0000
commit2c0820fb204f25b67f57ce917e44712965684e47 (patch)
tree468a74e9e230a50ad85fd8008e7c20144a432c35 /Src
parent3d8109090b3b09eed6f79e66822cafac6eed0da9 (diff)
downloadzsh-2c0820fb204f25b67f57ce917e44712965684e47.tar.gz
zsh-2c0820fb204f25b67f57ce917e44712965684e47.tar.xz
zsh-2c0820fb204f25b67f57ce917e44712965684e47.zip
16201: introduce the PM_NAMEDDIR flag
Diffstat (limited to 'Src')
-rw-r--r--Src/params.c6
-rw-r--r--Src/zsh.h1
2 files changed, 6 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c
index bff3d25a2..a89ea01e5 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -2138,6 +2138,7 @@ unsetparam_pm(Param pm, int altflag, int exp)
 	paramtab->addnode(paramtab, oldpm->nam, oldpm);
 	if ((PM_TYPE(oldpm->flags) == PM_SCALAR) &&
 	    !(pm->flags & PM_HASHELEM) &&
+	    (oldpm->flags & PM_NAMEDDIR) &&
 	    oldpm->sets.cfn == strsetfn)
 	    adduserdir(oldpm->nam, oldpm->u.str, 0, 0);
 	if (oldpm->flags & PM_EXPORTED) {
@@ -2226,8 +2227,11 @@ strsetfn(Param pm, char *x)
 {
     zsfree(pm->u.str);
     pm->u.str = x;
-    if (!(pm->flags & PM_HASHELEM))
+    if (!(pm->flags & PM_HASHELEM) &&
+	((pm->flags & PM_NAMEDDIR) || isset(AUTONAMEDIRS))) {
+	pm->flags |= PM_NAMEDDIR;
 	adduserdir(pm->nam, x, 0, 0);
+    }
 }
 
 /* Function to get value of an array parameter */
diff --git a/Src/zsh.h b/Src/zsh.h
index 3b6c0aad4..b5e446f6f 100644
--- a/Src/zsh.h
+++ b/Src/zsh.h
@@ -1132,6 +1132,7 @@ struct param {
 #define PM_AUTOLOAD	(1<<23) /* autoloaded from module                   */
 #define PM_NORESTORE	(1<<24)	/* do not restore value of local special    */
 #define PM_HASHELEM     (1<<25) /* is a hash-element */
+#define PM_NAMEDDIR     (1<<26) /* has a corresponding nameddirtab entry    */
 
 /* The option string corresponds to the first of the variables above */
 #define TYPESET_OPTSTR "aiEFALRZlurtxUhHT"