diff options
author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2013-12-06 09:47:28 +0200 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2013-12-06 09:28:42 +0000 |
commit | b28a6365f6ea5a9fdb8b63dd1612f55eb4034990 (patch) | |
tree | d439bf26b3ba376c2fa8d43eebf20b86f7e60ee4 /Src/exec.c | |
parent | c1a15fb1522b85a0780ce3f67ec1254115b18501 (diff) | |
download | zsh-b28a6365f6ea5a9fdb8b63dd1612f55eb4034990.tar.gz zsh-b28a6365f6ea5a9fdb8b63dd1612f55eb4034990.tar.xz zsh-b28a6365f6ea5a9fdb8b63dd1612f55eb4034990.zip |
32091: WARN_CREATE_GLOBAL false positive.
In cases like () { foo=bar =true; }
Diffstat (limited to 'Src/exec.c')
-rw-r--r-- | Src/exec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c index df915e152..dccdc2b0d 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3309,7 +3309,10 @@ execcmd(Estate state, int input, int output, int how, int last1) } if (type == WC_SIMPLE) { if (varspc) { - addvars(state, varspc, ADDVAR_EXPORT|ADDVAR_RESTRICT); + int addflags = ADDVAR_EXPORT|ADDVAR_RESTRICT; + if (forked) + addflags |= ADDVAR_RESTORE; + addvars(state, varspc, addflags); if (errflag) _exit(1); } |