Commit d98a67c5 authored by Bart Schaefer's avatar Bart Schaefer

16201: introduce the PM_NAMEDDIR flag

parent 7f1ce570
......@@ -2147,6 +2147,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) {
......@@ -2231,8 +2232,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 */
......
......@@ -1134,6 +1134,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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment