mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-09-22 11:51:04 +02:00
keep association elements from being exported
This commit is contained in:
parent
c15ef20346
commit
8488dcb806
@ -1,5 +1,9 @@
|
||||
2000-04-03 Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
|
||||
|
||||
* 10463: Src/builtin.c, Src/params.c, Src/zsh.h: PM_HASHELEM
|
||||
flag to keep association elements from being exported with
|
||||
ALL_EXPORT set
|
||||
|
||||
* 10459: Completion/Commands/_next_tags, Doc/Zsh/compwid.yo,
|
||||
Src/Zle/compcore.c: _next_tags should be usable with menu-
|
||||
completion
|
||||
|
@ -1630,7 +1630,8 @@ typeset_single(char *cname, char *pname, Param pm, int func,
|
||||
if (!(pm->flags & PM_UNSET) && !pm->env && !value)
|
||||
pm->env = addenv(pname, getsparam(pname), pm->flags);
|
||||
} else if (pm->env &&
|
||||
(!pm->level || (isset(ALLEXPORT) && !pm->old))) {
|
||||
(!pm->level || (isset(ALLEXPORT) && !pm->old &&
|
||||
!(pm->flags & PM_HASHELEM)))) {
|
||||
delenv(pm->env);
|
||||
zsfree(pm->env);
|
||||
pm->env = NULL;
|
||||
|
@ -617,6 +617,9 @@ createparam(char *name, int flags)
|
||||
{
|
||||
Param pm, oldpm;
|
||||
|
||||
if (paramtab != realparamtab)
|
||||
flags = (flags & ~PM_EXPORTED) | PM_HASHELEM;
|
||||
|
||||
if (name != nulstring) {
|
||||
oldpm = (Param) (paramtab == realparamtab ?
|
||||
gethashnode2(paramtab, name) :
|
||||
@ -646,7 +649,7 @@ createparam(char *name, int flags)
|
||||
paramtab->addnode(paramtab, ztrdup(name), pm);
|
||||
}
|
||||
|
||||
if (isset(ALLEXPORT) && !oldpm)
|
||||
if (isset(ALLEXPORT) && !oldpm && !(flags & PM_HASHELEM))
|
||||
flags |= PM_EXPORTED;
|
||||
} else {
|
||||
pm = (Param) zhalloc(sizeof *pm);
|
||||
@ -1520,7 +1523,7 @@ setstrvalue(Value v, char *val)
|
||||
break;
|
||||
}
|
||||
if ((!v->pm->env && !(v->pm->flags & PM_EXPORTED) &&
|
||||
!(isset(ALLEXPORT) && !v->pm->old)) ||
|
||||
!(isset(ALLEXPORT) && !v->pm->old && !(v->pm->flags & PM_HASHELEM))) ||
|
||||
(v->pm->flags & PM_ARRAY) || v->pm->ename)
|
||||
return;
|
||||
if (PM_TYPE(v->pm->flags) == PM_INTEGER)
|
||||
@ -2742,7 +2745,7 @@ arrfixenv(char *s, char **t)
|
||||
*/
|
||||
if (t == path)
|
||||
cmdnamtab->emptytable(cmdnamtab);
|
||||
if (isset(ALLEXPORT) ? !!pm->old : pm->level)
|
||||
if ((pm->flags & PM_HASHELEM) || (isset(ALLEXPORT) ? !!pm->old : pm->level))
|
||||
return;
|
||||
u = t ? zjoin(t, ':', 1) : "";
|
||||
len_s = strlen(s);
|
||||
|
@ -1125,6 +1125,7 @@ struct param {
|
||||
#define PM_REMOVABLE (1<<21) /* special can be removed from paramtab */
|
||||
#define PM_AUTOLOAD (1<<22) /* autoloaded from module */
|
||||
#define PM_NORESTORE (1<<23) /* do not restore value of local special */
|
||||
#define PM_HASHELEM (1<<24) /* is a hash-element */
|
||||
|
||||
/* The option string corresponds to the first of the variables above */
|
||||
#define TYPESET_OPTSTR "aiEFALRZlurtxUhT"
|
||||
|
Loading…
Reference in New Issue
Block a user