aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-03-14 20:33:00 +0000
committerRon Yorston <rmy@pobox.com>2015-03-14 20:33:00 +0000
commita4f58436b78fe59e57620c6e0301f213ee25f273 (patch)
tree8355f724926e605280af2d6f2b1ccc6b1bd02dee /libbb/appletlib.c
parentba0c36cfcf84efbac6f89e27238e04bb57e9cd45 (diff)
parent49acc1a7618a28d34381cbb7661d7c981fcb238f (diff)
downloadbusybox-w32-a4f58436b78fe59e57620c6e0301f213ee25f273.tar.gz
busybox-w32-a4f58436b78fe59e57620c6e0301f213ee25f273.tar.bz2
busybox-w32-a4f58436b78fe59e57620c6e0301f213ee25f273.zip
Merge branch 'busybox' into merge
Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r--libbb/appletlib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index dba66cc93..3f51ecef6 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -197,7 +197,7 @@ void lbb_prepare(const char *applet
197 if (argv[1] 197 if (argv[1]
198 && !argv[2] 198 && !argv[2]
199 && strcmp(argv[1], "--help") == 0 199 && strcmp(argv[1], "--help") == 0
200 && strncmp(applet, "busybox", 7) != 0 200 && !is_prefixed_with(applet, "busybox")
201 ) { 201 ) {
202 /* Special case. POSIX says "test --help" 202 /* Special case. POSIX says "test --help"
203 * should be no different from e.g. "test --foo". */ 203 * should be no different from e.g. "test --foo". */
@@ -686,7 +686,7 @@ static int busybox_main(char **argv)
686 return 0; 686 return 0;
687 } 687 }
688 688
689 if (strncmp(argv[1], "--list", 6) == 0) { 689 if (is_prefixed_with(argv[1], "--list")) {
690 unsigned i = 0; 690 unsigned i = 0;
691 const char *a = applet_names; 691 const char *a = applet_names;
692 dup2(1, 2); 692 dup2(1, 2);
@@ -791,7 +791,7 @@ void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
791 int applet = find_applet_by_name(name); 791 int applet = find_applet_by_name(name);
792 if (applet >= 0) 792 if (applet >= 0)
793 run_applet_no_and_exit(applet, argv); 793 run_applet_no_and_exit(applet, argv);
794 if (strncmp(name, "busybox", 7) == 0) 794 if (is_prefixed_with(name, "busybox"))
795 exit(busybox_main(argv)); 795 exit(busybox_main(argv));
796} 796}
797 797
@@ -842,7 +842,7 @@ int main(int argc UNUSED_PARAM, char **argv)
842 842
843#if defined(SINGLE_APPLET_MAIN) 843#if defined(SINGLE_APPLET_MAIN)
844 /* Only one applet is selected in .config */ 844 /* Only one applet is selected in .config */
845 if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { 845 if (argv[1] && is_prefixed_with(argv[0], "busybox")) {
846 /* "busybox <applet> <params>" should still work as expected */ 846 /* "busybox <applet> <params>" should still work as expected */
847 argv++; 847 argv++;
848 } 848 }