From c8de71ae9da30fcb01ec850354ad2c770f4353df Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 8 Nov 2014 18:03:25 -0600 Subject: [PATCH] Changes so that hush can successfully re-execute itself: *initialize the "environ" variable *Reduce the stack size to 8192 (This should still be further reduced based on analysis of usage.) --- Makefile | 2 +- shell/hush.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c10bec838..6f86edb56 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ DEFINES += -DF_SETFD=-1 -DFD_CLOEXEC=-1 # Optimize bit 6 breaks some standard-compliant varargs code, # and bits 0, 4, and 5 have known bugs. Disable for now. CFLAGS = -i -w -a0 -O8 -STACKSIZE = 20480 +STACKSIZE = 8192 .IF $(DEBUG) CFLAGS += -g -DDEBUG diff --git a/shell/hush.c b/shell/hush.c index 4b4c33298..22a4cc12b 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -8034,6 +8034,9 @@ int hush_main(int argc, char **argv) INIT_G(); hush_exec_path = get_exec_path(); +#ifdef __GNO__ + environInit(); +#endif if (EXIT_SUCCESS != 0) /* if EXIT_SUCCESS == 0, it is already done */ G.last_exitcode = EXIT_SUCCESS; #if ENABLE_HUSH_FAST