diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-13 17:57:45 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-13 17:57:45 +0000 |
commit | 6372332a92705260211c29701653e75443a54d20 (patch) | |
tree | ab9bc94e5c3ad1adc530262882b9517ddd4b6aa8 /Src | |
parent | cf92384eac7c961d96a9bf3bde3df8f8427b45bc (diff) | |
download | zsh-6372332a92705260211c29701653e75443a54d20.tar.gz zsh-6372332a92705260211c29701653e75443a54d20.tar.xz zsh-6372332a92705260211c29701653e75443a54d20.zip |
10743: fix replenv() of imported special parameters
Diffstat (limited to 'Src')
-rw-r--r-- | Src/params.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Src/params.c b/Src/params.c index 6a9dfe588..74c4ee1c8 100644 --- a/Src/params.c +++ b/Src/params.c @@ -454,6 +454,7 @@ createparamtable(void) { Param ip, pm; char **new_environ, **envp, **envp2, **sigptr, **t; + char **old_environ = environ; char buf[50], *str, *iname; int num_env, oae = opts[ALLEXPORT]; #ifdef HAVE_UNAME @@ -516,9 +517,12 @@ createparamtable(void) pm->flags |= PM_EXPORTED; pm->env = *envp++ = ztrdup(*envp2); *envp = NULL; - if (pm->flags & PM_SPECIAL) + if (pm->flags & PM_SPECIAL) { + environ = new_environ; pm->env = replenv(pm->env, getsparam(pm->nam), pm->flags); + environ = old_environ; + } } } *str = '='; |