diff options
author | Denys Vlasenko | 2017-01-10 15:13:30 +0100 |
---|---|---|
committer | Denys Vlasenko | 2017-01-10 15:13:30 +0100 |
commit | 265062d59dd46065ad34519f04615fb2cecefe8a (patch) | |
tree | 6f5d8a3f87a9718b06dca325554410a3337f5b0f /shell/hush.c | |
parent | f560422fa079b07a761a572ca4f9cf287c2cc47e (diff) | |
download | busybox-265062d59dd46065ad34519f04615fb2cecefe8a.zip busybox-265062d59dd46065ad34519f04615fb2cecefe8a.tar.gz |
shells: make hush test optional, rename ASH_BUILTIN_foo -> ASH_foo
This makes hash and ash more symmetrical wrt config menu and config
options.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r-- | shell/hush.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c index 9e508fc..c0325cf 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -197,6 +197,11 @@ //config: default y //config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH //config: +//config:config HUSH_TEST +//config: bool "test builtin" +//config: default y +//config: depends on HUSH || SH_IS_HUSH || BASH_IS_HUSH +//config: //config:config HUSH_HELP //config: bool "help builtin" //config: default y @@ -942,7 +947,9 @@ static int builtin_set(char **argv) FAST_FUNC; #endif static int builtin_shift(char **argv) FAST_FUNC; static int builtin_source(char **argv) FAST_FUNC; +#if ENABLE_HUSH_TEST static int builtin_test(char **argv) FAST_FUNC; +#endif #if ENABLE_HUSH_TRAP static int builtin_trap(char **argv) FAST_FUNC; #endif @@ -1061,7 +1068,9 @@ static const struct built_in_command bltins1[] = { #endif }; static const struct built_in_command bltins2[] = { +#if ENABLE_HUSH_TEST BLTIN("[" , builtin_test , NULL), +#endif #if ENABLE_HUSH_ECHO BLTIN("echo" , builtin_echo , NULL), #endif @@ -1069,7 +1078,9 @@ static const struct built_in_command bltins2[] = { BLTIN("printf" , builtin_printf , NULL), #endif BLTIN("pwd" , builtin_pwd , NULL), +#if ENABLE_HUSH_TEST BLTIN("test" , builtin_test , NULL), +#endif }; @@ -8791,6 +8802,7 @@ static int FAST_FUNC builtin_true(char **argv UNUSED_PARAM) return 0; } +#if ENABLE_HUSH_TEST || ENABLE_HUSH_ECHO || ENABLE_HUSH_PRINTF || ENABLE_HUSH_KILL static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char **argv)) { int argc = 0; @@ -8800,11 +8812,13 @@ static int run_applet_main(char **argv, int (*applet_main_func)(int argc, char * } return applet_main_func(argc, argv - argc); } - +#endif +#if ENABLE_HUSH_TEST static int FAST_FUNC builtin_test(char **argv) { return run_applet_main(argv, test_main); } +#endif #if ENABLE_HUSH_ECHO static int FAST_FUNC builtin_echo(char **argv) { |