aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-04-03 09:40:47 +0100
committerRon Yorston <rmy@pobox.com>2018-04-03 12:28:21 +0100
commited8eb229df581c702e44a352aaf4ed47b64bf623 (patch)
tree953df3a55d3c75b80f6e1553d5b8cfa38fffa614 /shell
parentb7115d6ab736c0e9968bec3460ffa5cb12c94965 (diff)
downloadbusybox-w32-ed8eb229df581c702e44a352aaf4ed47b64bf623.tar.gz
busybox-w32-ed8eb229df581c702e44a352aaf4ed47b64bf623.tar.bz2
busybox-w32-ed8eb229df581c702e44a352aaf4ed47b64bf623.zip
ash: reinstate applet name variable after forkshell
When 'sh --forkshell' is invoked the BB_APPLET_<pid> environment variable is set, but then it's cleared when the environment of the child process is restored. Reinstate it in reinitvar.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 6d24fb55a..2a1ddac39 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -14975,6 +14975,13 @@ reinitvar(void)
14975 varinit[i].var_func = varinit_data[i].var_func; 14975 varinit[i].var_func = varinit_data[i].var_func;
14976 } 14976 }
14977 vlineno.var_text = linenovar; 14977 vlineno.var_text = linenovar;
14978
14979 /*
14980 * BB_APPLET_<pid> was correct when 'sh --forkshell' was started
14981 * but has now been overwritten by the environment from the forkshell
14982 * data block. Reinstate it.
14983 */
14984 setvareq(bb_applet_pid(), VEXPORT);
14978} 14985}
14979 14986
14980/* FIXME: should consider running forkparent() and forkchild() */ 14987/* FIXME: should consider running forkparent() and forkchild() */