summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-09-06 12:10:51 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2010-09-06 12:10:51 +0200
commit605067b4261df056b0d0e45028a191824bcdce31 (patch)
tree620641d8e733487f0df3641922d3a2c0c7c4ae86
parent83b900fb82a42b56a0130cfe7fb4406fef8b1b54 (diff)
downloadbusybox-w32-605067b4261df056b0d0e45028a191824bcdce31.tar.gz
busybox-w32-605067b4261df056b0d0e45028a191824bcdce31.tar.bz2
busybox-w32-605067b4261df056b0d0e45028a191824bcdce31.zip
hush: revert a recent buggy change which resulted in two HUSH_VERSIONs
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r--shell/hush.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 991737c59..541962470 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -7329,14 +7329,10 @@ int hush_main(int argc, char **argv)
7329 * therefore we xstrdup: */ 7329 * therefore we xstrdup: */
7330 G.shell_ver.varstr = xstrdup(hush_version_str), 7330 G.shell_ver.varstr = xstrdup(hush_version_str),
7331 G.top_var = &G.shell_ver; 7331 G.top_var = &G.shell_ver;
7332 /* Create shell local variables from the values
7333 * currently living in the environment */
7332 debug_printf_env("unsetenv '%s'\n", "HUSH_VERSION"); 7334 debug_printf_env("unsetenv '%s'\n", "HUSH_VERSION");
7333 unsetenv("HUSH_VERSION"); /* in case it exists in initial env */ 7335 unsetenv("HUSH_VERSION"); /* in case it exists in initial env */
7334 /* reinstate HUSH_VERSION in environment */
7335 debug_printf_env("putenv '%s'\n", G.shell_ver.varstr);
7336 putenv(G.shell_ver.varstr);
7337
7338 /* Initialize our shell local variables with the values
7339 * currently living in the environment */
7340 cur_var = G.top_var; 7336 cur_var = G.top_var;
7341 e = environ; 7337 e = environ;
7342 if (e) while (*e) { 7338 if (e) while (*e) {
@@ -7350,6 +7346,9 @@ int hush_main(int argc, char **argv)
7350 } 7346 }
7351 e++; 7347 e++;
7352 } 7348 }
7349 /* (Re)insert HUSH_VERSION into env (AFTER we scanned the env!) */
7350 debug_printf_env("putenv '%s'\n", G.shell_ver.varstr);
7351 putenv(G.shell_ver.varstr);
7353 7352
7354 /* Export PWD */ 7353 /* Export PWD */
7355 set_pwd_var(/*exp:*/ 1); 7354 set_pwd_var(/*exp:*/ 1);