From 1448f3244714a9dabb5240ec18b094f100887d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20B=C3=ADlka?= Date: Mon, 10 Feb 2014 14:22:31 +0100 Subject: Fix previous commit. --- stdlib/setenv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdlib/setenv.c b/stdlib/setenv.c index 3043498..6b5f9be 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; -- cgit v1.1