From 80d14beae9ebe64d3be1e6c2771f292977cf6d2c Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 10 Apr 2007 23:03:30 +0000 Subject: Rename two config options: FEATURE_SH_STANDALONE_SHELL => FEATURE_SH_STANDALONE FEATURE_EXEC_PREFER_APPLETS => FEATURE_PREFER_APPLETS Make SH_STANDALONE depend on PREFER_APPLETS. getopt.c: more randomconfig-induced fixes --- shell/Config.in | 4 ++-- shell/ash.c | 8 ++++---- shell/hush.c | 2 +- shell/lash.c | 2 +- shell/msh.c | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'shell') diff --git a/shell/Config.in b/shell/Config.in index 4b7270efd..9479e3fed 100644 --- a/shell/Config.in +++ b/shell/Config.in @@ -216,10 +216,10 @@ config FEATURE_SH_EXTRA_QUIET help Remove the busybox introduction when starting a shell. -config FEATURE_SH_STANDALONE_SHELL +config FEATURE_SH_STANDALONE bool "Standalone shell" default n - depends on MSH || LASH || HUSH || ASH + depends on (MSH || LASH || HUSH || ASH) && FEATURE_PREFER_APPLETS help This option causes the selected busybox shell to use busybox applets in preference to executables in the PATH whenever possible. For diff --git a/shell/ash.c b/shell/ash.c index b4278424a..bebfec8f5 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -6531,7 +6531,7 @@ tryexec(char *cmd, char **argv, char **envp) { int repeated = 0; -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE if (strchr(cmd, '/') == NULL) { const struct bb_applet *a; @@ -6596,7 +6596,7 @@ shellexec(char **argv, const char *path, int idx) clearredir(1); envp = environment(); if (strchr(argv[0], '/') -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE || find_applet_by_name(argv[0]) #endif ) { @@ -11116,7 +11116,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) return; } -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE if (find_applet_by_name(name)) { entry->cmdtype = CMDNORMAL; entry->u.index = -1; @@ -11341,7 +11341,7 @@ helpcmd(int argc, char **argv) col = 0; } } -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE for (i = 0; i < NUM_APPLETS; i++) { col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), applets[i].name); if (col > 60) { diff --git a/shell/hush.c b/shell/hush.c index 666604dd9..f6c69a221 100644 --- a/shell/hush.c +++ b/shell/hush.c @@ -1112,7 +1112,7 @@ static void pseudo_exec(struct child_prog *child) * really dislike relying on /proc for things. We could exec ourself * from global_argv[0], but if we are in a chroot, we may not be able * to find ourself... */ -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE { int argc_l; char** argv_l = child->argv; diff --git a/shell/lash.c b/shell/lash.c index f9d9deb62..99e2b1f06 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -1164,7 +1164,7 @@ static int pseudo_exec(struct child_prog *child) * /bin/foo invocation will fork and exec /bin/foo, even if * /bin/foo is a symlink to busybox. */ - if (ENABLE_FEATURE_SH_STANDALONE_SHELL) { + if (ENABLE_FEATURE_SH_STANDALONE) { char **argv_l = child->argv; int argc_l; diff --git a/shell/msh.c b/shell/msh.c index 23a7c0498..0337a4f06 100644 --- a/shell/msh.c +++ b/shell/msh.c @@ -37,7 +37,7 @@ # define DEFAULT_SHELL "/proc/self/exe" # define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" # define BB_BANNER "busybox standalone" -# define ENABLE_FEATURE_SH_STANDALONE_SHELL 0 +# define ENABLE_FEATURE_SH_STANDALONE 0 # define bb_msg_memory_exhausted "memory exhausted" # define xmalloc(size) malloc(size) # define msh_main(argc,argv) main(argc,argv) @@ -3064,7 +3064,7 @@ static const char *rexecve(char *c, char **v, char **envp) int eacces = 0, asis = 0; char *name = c; - if (ENABLE_FEATURE_SH_STANDALONE_SHELL) { + if (ENABLE_FEATURE_SH_STANDALONE) { optind = 1; if (find_applet_by_name(name)) { /* We have to exec here since we vforked. Running @@ -3195,7 +3195,7 @@ static int dohelp(struct op *t) } x++; } -#if ENABLE_FEATURE_SH_STANDALONE_SHELL +#if ENABLE_FEATURE_SH_STANDALONE { const struct bb_applet *applet = applets; -- cgit v1.2.3