aboutsummaryrefslogtreecommitdiff
path: root/sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'sh.c')
-rw-r--r--sh.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sh.c b/sh.c
index b1a7b93cf..9519538dc 100644
--- a/sh.c
+++ b/sh.c
@@ -1370,7 +1370,6 @@ static int pseudo_exec(struct child_prog *child)
1370{ 1370{
1371 struct built_in_command *x; 1371 struct built_in_command *x;
1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL 1372#ifdef BB_FEATURE_SH_STANDALONE_SHELL
1373 struct BB_applet *applet;
1374 char *name; 1373 char *name;
1375#endif 1374#endif
1376 1375
@@ -1415,14 +1414,12 @@ static int pseudo_exec(struct child_prog *child)
1415 name = get_last_path_component(name); 1414 name = get_last_path_component(name);
1416#endif 1415#endif
1417 1416
1418 /* Do a binary search to find the applet entry given the name. */ 1417 {
1419 if ((applet = find_applet_by_name(name)) != NULL) { 1418 char** argv=child->argv;
1420 int argc_l; 1419 int argc_l;
1421 char** argv=child->argv; 1420 for(argc_l=0;*argv!=NULL; argv++, argc_l++);
1422 for(argc_l=0;*argv!=NULL; argv++, argc_l++); 1421 optind = 1;
1423 applet_name=applet->name; 1422 run_applet_by_name(name, argc_l, child->argv);
1424 optind = 1;
1425 exit((*(applet->main)) (argc_l, child->argv));
1426 } 1423 }
1427#endif 1424#endif
1428 1425
@@ -1750,7 +1747,7 @@ int shell_main(int argc_l, char **argv_l)
1750 interactive = TRUE; 1747 interactive = TRUE;
1751 break; 1748 break;
1752 default: 1749 default:
1753 usage(shell_usage); 1750 show_usage();
1754 } 1751 }
1755 } 1752 }
1756 /* A shell is interactive if the `-i' flag was given, or if all of 1753 /* A shell is interactive if the `-i' flag was given, or if all of