From 931523b2136e9edfe50b1246f0f19907b33d20be Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Tue, 28 Sep 1999 13:43:47 +0000 Subject: zsh-workers/8086 --- Src/exec.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index d093c7701..710402f86 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1336,9 +1336,6 @@ addvars(LinkList l, int export) for (n = firstnode(l); n; incnode(n)) { v = (Varasg) getdata(n); name = dupstring(v->name); - singsub(&name); - if (errflag) - return; untokenize(name); if (xtr) fprintf(stderr, "%s=", name); @@ -1370,15 +1367,13 @@ addvars(LinkList l, int export) } if (xtr) fprintf(stderr, "%s ", val); - if (export) { - if (export < 0) { - /* We are going to fork so do not bother freeing this */ - pm = (Param) paramtab->removenode(paramtab, name); - if (isset(RESTRICTED) && (pm->flags & PM_RESTRICTED)) { - zerr("%s: restricted", pm->nam, 0); - zsfree(val); - return; - } + if (export && !strchr(name, '[')) { + if (export < 0 && isset(RESTRICTED) && + (pm = (Param) paramtab->removenode(paramtab, name)) && + (pm->flags & PM_RESTRICTED)) { + zerr("%s: restricted", pm->nam, 0); + zsfree(val); + return; } allexp = opts[ALLEXPORT]; opts[ALLEXPORT] = 1; -- cgit 1.4.1