aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-16 05:24:03 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-16 05:24:03 +0000
commit716d34b7be144daf1fbafbe9044caa3c59649ea7 (patch)
treeab4649ded0ebe00fedb48dd4142f1684dc95be8d /shell
parent6d8030f99aa680856a2c9a7ea3582d73961f085f (diff)
downloadbusybox-w32-716d34b7be144daf1fbafbe9044caa3c59649ea7.tar.gz
busybox-w32-716d34b7be144daf1fbafbe9044caa3c59649ea7.tar.bz2
busybox-w32-716d34b7be144daf1fbafbe9044caa3c59649ea7.zip
Move init of a bunch of globals into main so we are at least
a bit more reentrant. -Erik git-svn-id: svn://busybox.net/trunk/busybox@2652 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/shell/hush.c b/shell/hush.c
index 5a4966b07..c938fb1e3 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -239,17 +239,17 @@ unsigned int shell_context; /* Used in cmdedit.c to reset the
239 * context when someone hits ^C */ 239 * context when someone hits ^C */
240 240
241/* "globals" within this file */ 241/* "globals" within this file */
242static char *ifs=NULL; 242static char *ifs;
243static char map[256]; 243static char map[256];
244static int fake_mode=0; 244static int fake_mode;
245static int interactive=0; 245static int interactive;
246static struct close_me *close_me_head = NULL; 246static struct close_me *close_me_head;
247static const char *cwd; 247static const char *cwd;
248static struct jobset *job_list; 248static struct jobset *job_list;
249static unsigned int last_bg_pid=0; 249static unsigned int last_bg_pid;
250static char *PS1; 250static char *PS1;
251static char *PS2 = "> "; 251static char *PS2;
252static char **__shell_local_env = 0; 252static char **__shell_local_env;
253 253
254#define B_CHUNK (100) 254#define B_CHUNK (100)
255#define B_NOSPAC 1 255#define B_NOSPAC 1
@@ -2511,7 +2511,16 @@ int shell_main(int argc, char **argv)
2511 int opt; 2511 int opt;
2512 FILE *input; 2512 FILE *input;
2513 struct jobset joblist_end = { NULL, NULL }; 2513 struct jobset joblist_end = { NULL, NULL };
2514
2515 /* (re?) initialize globals */
2516 ifs=NULL;
2517 fake_mode=0;
2518 interactive=0;
2519 close_me_head = NULL;
2514 job_list = &joblist_end; 2520 job_list = &joblist_end;
2521 last_bg_pid=0;
2522 PS2 = "> ";
2523 __shell_local_env = 0;
2515 2524
2516 last_return_code=EXIT_SUCCESS; 2525 last_return_code=EXIT_SUCCESS;
2517 2526