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.)
This commit is contained in:
Stephen Heumann 2014-11-08 18:03:25 -06:00
parent 8f7e30fc8b
commit c8de71ae9d
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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