diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-16 05:24:03 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-16 05:24:03 +0000 |
commit | 716d34b7be144daf1fbafbe9044caa3c59649ea7 (patch) | |
tree | ab4649ded0ebe00fedb48dd4142f1684dc95be8d /shell | |
parent | 6d8030f99aa680856a2c9a7ea3582d73961f085f (diff) | |
download | busybox-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.c | 23 |
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 */ |
242 | static char *ifs=NULL; | 242 | static char *ifs; |
243 | static char map[256]; | 243 | static char map[256]; |
244 | static int fake_mode=0; | 244 | static int fake_mode; |
245 | static int interactive=0; | 245 | static int interactive; |
246 | static struct close_me *close_me_head = NULL; | 246 | static struct close_me *close_me_head; |
247 | static const char *cwd; | 247 | static const char *cwd; |
248 | static struct jobset *job_list; | 248 | static struct jobset *job_list; |
249 | static unsigned int last_bg_pid=0; | 249 | static unsigned int last_bg_pid; |
250 | static char *PS1; | 250 | static char *PS1; |
251 | static char *PS2 = "> "; | 251 | static char *PS2; |
252 | static char **__shell_local_env = 0; | 252 | static 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 | ||