From cca7c611f26d98415c0f986e5a5e731ab5e379ff Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 12 Jan 2018 13:21:33 +0100 Subject: which: fix TODO with NOFORK+malloc_failure misbehaving function old new delta find_executable 86 104 +18 which_main 202 194 -8 executable_exists 66 51 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 18/-23) Total: -5 bytes Signed-off-by: Denys Vlasenko --- include/libbb.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/libbb.h b/include/libbb.h index daccf154a..5f25b5dde 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -2005,10 +2005,16 @@ extern const char bb_path_wtmp_file[] ALIGN1; #define bb_dev_null "/dev/null" extern const char bb_busybox_exec_path[] ALIGN1; -/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, - * but I want to save a few bytes here */ -extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ +/* allow default system PATH to be extended via CFLAGS */ +#ifndef BB_ADDITIONAL_PATH +#define BB_ADDITIONAL_PATH "" +#endif +#define BB_PATH_ROOT_PATH "PATH=/sbin:/usr/sbin:/bin:/usr/bin" BB_ADDITIONAL_PATH +extern const char bb_PATH_root_path[] ALIGN1; /* BB_PATH_ROOT_PATH */ #define bb_default_root_path (bb_PATH_root_path + sizeof("PATH")) +/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, + * but I want to save a few bytes here: + */ #define bb_default_path (bb_PATH_root_path + sizeof("PATH=/sbin:/usr/sbin")) extern const int const_int_0; -- cgit v1.2.3