From 3194a475deb5e3e9e7aef680d9bf5fb0a63d551a Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 8 May 2022 11:05:30 +0100 Subject: ash: export certain variables to the environment immediately The environment variables BB_OVERRIDE_APPLETS, BB_SKIP_ANSI_EMULATION and BB_SYSTEMROOT affect of the behaviour of the shell itself. Setting them as shell variables is insufficient for them to affect the current shell. When these three variables are exported from the shell they are now placed in the environment immediately. Conversely, when they're unset or unexported they're removed from the environment. --- include/libbb.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index 482fcce0c..6d6fc28f0 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -2360,7 +2360,11 @@ extern const char bb_busybox_exec_path[] ALIGN1; #define BB_PATH_ROOT_PATH "PATH=/sbin;/usr/sbin;/bin;/usr/bin" BB_ADDITIONAL_PATH #define PATH_SEP ';' #define PATH_SEP_STR ";" -extern const char bb_skip_ansi_emulation[] ALIGN1; +extern const char bbvar[] ALIGN1; +#define bbafter(p) (p + sizeof(#p)) +#define BB_OVERRIDE_APPLETS bbvar +#define BB_SKIP_ANSI_EMULATION bbafter(BB_OVERRIDE_APPLETS) +#define BB_SYSTEMROOT bbafter(BB_SKIP_ANSI_EMULATION) #endif extern const char bb_PATH_root_path[] ALIGN1; /* BB_PATH_ROOT_PATH */ #define bb_default_root_path (bb_PATH_root_path + sizeof("PATH")) -- cgit v1.2.3-55-g6feb