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 | |
parent | cf92384eac7c961d96a9bf3bde3df8f8427b45bc (diff) | |
download | zsh-6372332a92705260211c29701653e75443a54d20.tar.gz zsh-6372332a92705260211c29701653e75443a54d20.tar.xz zsh-6372332a92705260211c29701653e75443a54d20.zip |
10743: fix replenv() of imported special parameters
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Src/params.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog index 2a9133ef3..7b1a71a7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2000-04-13 Peter Stephenson <pws@cambridgesiliconradio.com> + * 10743: Src/params.c: replenv() failed importing special params + at start up because it was using the wrong environment block. + * 10738: Doc/Zsh/builtins.yo, Doc/Zsh/params.yo, Src/builtin.c, Src/params.c: local parameters can be exported; typeset +g -x and local -x work in a natural way; currently typeset -g still 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 = '='; |