diff options
author | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-04-10 23:03:30 +0000 |
---|---|---|
committer | vda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2007-04-10 23:03:30 +0000 |
commit | af0dfd1b9fbb1ba8ccba9f220018e6819180149e (patch) | |
tree | d0dd803ca8b6c70521895fd5ec71ef532861b8e4 /shell | |
parent | ca47f469046173726e352cef459929bd27d132bd (diff) | |
download | busybox-w32-af0dfd1b9fbb1ba8ccba9f220018e6819180149e.tar.gz busybox-w32-af0dfd1b9fbb1ba8ccba9f220018e6819180149e.tar.bz2 busybox-w32-af0dfd1b9fbb1ba8ccba9f220018e6819180149e.zip |
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
git-svn-id: svn://busybox.net/trunk/busybox@18394 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Config.in | 4 | ||||
-rw-r--r-- | shell/ash.c | 8 | ||||
-rw-r--r-- | shell/hush.c | 2 | ||||
-rw-r--r-- | shell/lash.c | 2 | ||||
-rw-r--r-- | shell/msh.c | 6 |
5 files changed, 11 insertions, 11 deletions
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 | |||
216 | help | 216 | help |
217 | Remove the busybox introduction when starting a shell. | 217 | Remove the busybox introduction when starting a shell. |
218 | 218 | ||
219 | config FEATURE_SH_STANDALONE_SHELL | 219 | config FEATURE_SH_STANDALONE |
220 | bool "Standalone shell" | 220 | bool "Standalone shell" |
221 | default n | 221 | default n |
222 | depends on MSH || LASH || HUSH || ASH | 222 | depends on (MSH || LASH || HUSH || ASH) && FEATURE_PREFER_APPLETS |
223 | help | 223 | help |
224 | This option causes the selected busybox shell to use busybox applets | 224 | This option causes the selected busybox shell to use busybox applets |
225 | in preference to executables in the PATH whenever possible. For | 225 | 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) | |||
6531 | { | 6531 | { |
6532 | int repeated = 0; | 6532 | int repeated = 0; |
6533 | 6533 | ||
6534 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 6534 | #if ENABLE_FEATURE_SH_STANDALONE |
6535 | if (strchr(cmd, '/') == NULL) { | 6535 | if (strchr(cmd, '/') == NULL) { |
6536 | const struct bb_applet *a; | 6536 | const struct bb_applet *a; |
6537 | 6537 | ||
@@ -6596,7 +6596,7 @@ shellexec(char **argv, const char *path, int idx) | |||
6596 | clearredir(1); | 6596 | clearredir(1); |
6597 | envp = environment(); | 6597 | envp = environment(); |
6598 | if (strchr(argv[0], '/') | 6598 | if (strchr(argv[0], '/') |
6599 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 6599 | #if ENABLE_FEATURE_SH_STANDALONE |
6600 | || find_applet_by_name(argv[0]) | 6600 | || find_applet_by_name(argv[0]) |
6601 | #endif | 6601 | #endif |
6602 | ) { | 6602 | ) { |
@@ -11116,7 +11116,7 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path) | |||
11116 | return; | 11116 | return; |
11117 | } | 11117 | } |
11118 | 11118 | ||
11119 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 11119 | #if ENABLE_FEATURE_SH_STANDALONE |
11120 | if (find_applet_by_name(name)) { | 11120 | if (find_applet_by_name(name)) { |
11121 | entry->cmdtype = CMDNORMAL; | 11121 | entry->cmdtype = CMDNORMAL; |
11122 | entry->u.index = -1; | 11122 | entry->u.index = -1; |
@@ -11341,7 +11341,7 @@ helpcmd(int argc, char **argv) | |||
11341 | col = 0; | 11341 | col = 0; |
11342 | } | 11342 | } |
11343 | } | 11343 | } |
11344 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 11344 | #if ENABLE_FEATURE_SH_STANDALONE |
11345 | for (i = 0; i < NUM_APPLETS; i++) { | 11345 | for (i = 0; i < NUM_APPLETS; i++) { |
11346 | col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), applets[i].name); | 11346 | col += out1fmt("%c%s", ((col == 0) ? '\t' : ' '), applets[i].name); |
11347 | if (col > 60) { | 11347 | 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) | |||
1112 | * really dislike relying on /proc for things. We could exec ourself | 1112 | * really dislike relying on /proc for things. We could exec ourself |
1113 | * from global_argv[0], but if we are in a chroot, we may not be able | 1113 | * from global_argv[0], but if we are in a chroot, we may not be able |
1114 | * to find ourself... */ | 1114 | * to find ourself... */ |
1115 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 1115 | #if ENABLE_FEATURE_SH_STANDALONE |
1116 | { | 1116 | { |
1117 | int argc_l; | 1117 | int argc_l; |
1118 | char** argv_l = child->argv; | 1118 | 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) | |||
1164 | * /bin/foo invocation will fork and exec /bin/foo, even if | 1164 | * /bin/foo invocation will fork and exec /bin/foo, even if |
1165 | * /bin/foo is a symlink to busybox. | 1165 | * /bin/foo is a symlink to busybox. |
1166 | */ | 1166 | */ |
1167 | if (ENABLE_FEATURE_SH_STANDALONE_SHELL) { | 1167 | if (ENABLE_FEATURE_SH_STANDALONE) { |
1168 | char **argv_l = child->argv; | 1168 | char **argv_l = child->argv; |
1169 | int argc_l; | 1169 | int argc_l; |
1170 | 1170 | ||
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 @@ | |||
37 | # define DEFAULT_SHELL "/proc/self/exe" | 37 | # define DEFAULT_SHELL "/proc/self/exe" |
38 | # define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" | 38 | # define CONFIG_BUSYBOX_EXEC_PATH "/proc/self/exe" |
39 | # define BB_BANNER "busybox standalone" | 39 | # define BB_BANNER "busybox standalone" |
40 | # define ENABLE_FEATURE_SH_STANDALONE_SHELL 0 | 40 | # define ENABLE_FEATURE_SH_STANDALONE 0 |
41 | # define bb_msg_memory_exhausted "memory exhausted" | 41 | # define bb_msg_memory_exhausted "memory exhausted" |
42 | # define xmalloc(size) malloc(size) | 42 | # define xmalloc(size) malloc(size) |
43 | # define msh_main(argc,argv) main(argc,argv) | 43 | # define msh_main(argc,argv) main(argc,argv) |
@@ -3064,7 +3064,7 @@ static const char *rexecve(char *c, char **v, char **envp) | |||
3064 | int eacces = 0, asis = 0; | 3064 | int eacces = 0, asis = 0; |
3065 | char *name = c; | 3065 | char *name = c; |
3066 | 3066 | ||
3067 | if (ENABLE_FEATURE_SH_STANDALONE_SHELL) { | 3067 | if (ENABLE_FEATURE_SH_STANDALONE) { |
3068 | optind = 1; | 3068 | optind = 1; |
3069 | if (find_applet_by_name(name)) { | 3069 | if (find_applet_by_name(name)) { |
3070 | /* We have to exec here since we vforked. Running | 3070 | /* We have to exec here since we vforked. Running |
@@ -3195,7 +3195,7 @@ static int dohelp(struct op *t) | |||
3195 | } | 3195 | } |
3196 | x++; | 3196 | x++; |
3197 | } | 3197 | } |
3198 | #if ENABLE_FEATURE_SH_STANDALONE_SHELL | 3198 | #if ENABLE_FEATURE_SH_STANDALONE |
3199 | { | 3199 | { |
3200 | const struct bb_applet *applet = applets; | 3200 | const struct bb_applet *applet = applets; |
3201 | 3201 | ||