aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-05-16 05:24:03 +0000
committerEric Andersen <andersen@codepoet.org>2001-05-16 05:24:03 +0000
commitbc604a2f417ea290913fedb6807e390e4fc8833e (patch)
treeab4649ded0ebe00fedb48dd4142f1684dc95be8d
parentf72f562b2f118d32d4ca49b6248805936a0cfa66 (diff)
downloadbusybox-w32-bc604a2f417ea290913fedb6807e390e4fc8833e.tar.gz
busybox-w32-bc604a2f417ea290913fedb6807e390e4fc8833e.tar.bz2
busybox-w32-bc604a2f417ea290913fedb6807e390e4fc8833e.zip
Move init of a bunch of globals into main so we are at least
a bit more reentrant. -Erik
-rw-r--r--hush.c23
-rw-r--r--shell/hush.c23
2 files changed, 32 insertions, 14 deletions
diff --git a/hush.c b/hush.c
index 5a4966b07..c938fb1e3 100644
--- a/hush.c
+++ b/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
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