diff options
author | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:22:31 +0100 |
---|---|---|
committer | Ondřej Bílka <neleai@seznam.cz> | 2014-02-10 14:22:31 +0100 |
commit | 1448f3244714a9dabb5240ec18b094f100887d5c (patch) | |
tree | c1dac2912517bfced0054353522ad832d1ddddeb /stdlib | |
parent | f3d338c9f3e84dac5458d388efd785c4ef0df7ec (diff) | |
download | glibc-1448f3244714a9dabb5240ec18b094f100887d5c.tar.gz glibc-1448f3244714a9dabb5240ec18b094f100887d5c.tar.xz glibc-1448f3244714a9dabb5240ec18b094f100887d5c.zip |
Fix previous commit.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/setenv.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stdlib/setenv.c b/stdlib/setenv.c index 3043498103..6b5f9be8d5 100644 --- a/stdlib/setenv.c +++ b/stdlib/setenv.c @@ -146,6 +146,11 @@ __add_to_environ (name, value, combined, replace) UNLOCK; return -1; } + + if (__environ != last_environ) + memcpy ((char *) new_environ, (char *) __environ, + size * sizeof (char *)); + new_environ[size] = NULL; new_environ[size + 1] = NULL; ep = new_environ + size; |