summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/shell/ash.c b/shell/ash.c
index b1f8f15..44b3569 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -158,6 +158,10 @@
//config: at build time. Like applets, scripts can be run as
//config: 'busybox SCRIPT ...' or by linking their name to the binary.
//config:
+//config: This also allows applets to be implemented as scripts: place
+//config: the script in 'applets_sh' and a stub C file containing
+//config: configuration in the appropriate subsystem directory.
+//config:
//config:endif # ash options
//applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
@@ -8016,9 +8020,6 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, c
{
#if ENABLE_FEATURE_SH_STANDALONE
if (applet_no >= 0) {
-# if NUM_SCRIPTS > 0
- if (applet_no < NUM_APPLETS)
-# endif
if (APPLET_IS_NOEXEC(applet_no)) {
clearenv();
while (*envp)
@@ -8088,9 +8089,6 @@ static void shellexec(char *prog, char **argv, const char *path, int idx)
if (strchr(prog, '/') != NULL
#if ENABLE_FEATURE_SH_STANDALONE
|| (applet_no = find_applet_by_name(prog)) >= 0
-# if NUM_SCRIPTS > 0
- || (applet_no = NUM_APPLETS + find_script_by_name(prog)) >= 0
-# endif
#endif
) {
tryexec(IF_FEATURE_SH_STANDALONE(applet_no,) prog, argv, envp);
@@ -10192,10 +10190,6 @@ evalcommand(union node *cmd, int flags)
*/
/* find_command() encodes applet_no as (-2 - applet_no) */
int applet_no = (- cmdentry.u.index - 2);
-# if NUM_SCRIPTS > 0
- /* Applets are ok, but not embedded scripts */
- if (applet_no < NUM_APPLETS)
-# endif
if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) {
char **sv_environ;
@@ -13378,11 +13372,6 @@ find_command(char *name, struct cmdentry *entry, int act, const char *path)
#if ENABLE_FEATURE_SH_STANDALONE
{
int applet_no = find_applet_by_name(name);
-# if NUM_SCRIPTS > 0
- if (applet_no < 0)
- /* embedded script indices are offset by NUM_APPLETS */
- applet_no = NUM_APPLETS + find_script_by_name(name);
-# endif
if (applet_no >= 0) {
entry->cmdtype = CMDNORMAL;
entry->u.index = -2 - applet_no;