aboutsummaryrefslogtreecommitdiff
path: root/libbb/appletlib.c
diff options
context:
space:
mode:
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 54300bd87..8fd8fd525 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -193,7 +193,7 @@ void lbb_prepare(const char *applet
193 if (argv[1] 193 if (argv[1]
194 && !argv[2] 194 && !argv[2]
195 && strcmp(argv[1], "--help") == 0 195 && strcmp(argv[1], "--help") == 0
196 && strncmp(applet, "busybox", 7) != 0 196 && !is_prefixed_with(applet, "busybox")
197 ) { 197 ) {
198 /* Special case. POSIX says "test --help" 198 /* Special case. POSIX says "test --help"
199 * should be no different from e.g. "test --foo". */ 199 * should be no different from e.g. "test --foo". */
@@ -673,7 +673,7 @@ static int busybox_main(char **argv)
673 return 0; 673 return 0;
674 } 674 }
675 675
676 if (strncmp(argv[1], "--list", 6) == 0) { 676 if (is_prefixed_with(argv[1], "--list")) {
677 unsigned i = 0; 677 unsigned i = 0;
678 const char *a = applet_names; 678 const char *a = applet_names;
679 dup2(1, 2); 679 dup2(1, 2);
@@ -778,7 +778,7 @@ void FAST_FUNC run_applet_and_exit(const char *name, char **argv)
778 int applet = find_applet_by_name(name); 778 int applet = find_applet_by_name(name);
779 if (applet >= 0) 779 if (applet >= 0)
780 run_applet_no_and_exit(applet, argv); 780 run_applet_no_and_exit(applet, argv);
781 if (strncmp(name, "busybox", 7) == 0) 781 if (is_prefixed_with(name, "busybox"))
782 exit(busybox_main(argv)); 782 exit(busybox_main(argv));
783} 783}
784 784
@@ -817,7 +817,7 @@ int main(int argc UNUSED_PARAM, char **argv)
817 817
818#if defined(SINGLE_APPLET_MAIN) 818#if defined(SINGLE_APPLET_MAIN)
819 /* Only one applet is selected in .config */ 819 /* Only one applet is selected in .config */
820 if (argv[1] && strncmp(argv[0], "busybox", 7) == 0) { 820 if (argv[1] && is_prefixed_with(argv[0], "busybox")) {
821 /* "busybox <applet> <params>" should still work as expected */ 821 /* "busybox <applet> <params>" should still work as expected */
822 argv++; 822 argv++;
823 } 823 }