From bd7c5c0555477d562bc7a4dab9561017a47b615e Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 2 May 2019 18:41:11 -0700 Subject: env: fix case where a variable is replaced. Found when trying to update the toybox prebuilt used for the Android build. Also add the corresponding test. --- lib/env.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/env.c') diff --git a/lib/env.c b/lib/env.c index 35ef688c..bc23b753 100644 --- a/lib/env.c +++ b/lib/env.c @@ -58,11 +58,9 @@ void xsetenv(char *name, char *val) if (!memcmp(name, environ[i], len) && environ[i][len]=='=') { if (i>=envc) free(environ[i]); else { - char **delete = environ+i; - // move old entries down, add at end of old data toys.envc = envc--; - for (i=0; new ? i