Allow "busybox <applet>" to work when busybox is disabled
authorRon Yorston <rmy@pobox.com>
Tue, 7 Jun 2016 09:26:24 +0000 (10:26 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 18 Jun 2016 17:15:20 +0000 (19:15 +0200)
A recent commit made it possible to disable BusyBox's --install
and --list options.  However it also stopped "busybox <applet>
<params>" from working.

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libbb/appletlib.c

index 281123c37e16582c6c462ed97ffb0b2f5b0666ce..b6fe1dad2af10e85e5852f2998765b2dd7ae797d 100644 (file)
@@ -956,6 +956,10 @@ int main(int argc UNUSED_PARAM, char **argv)
 #else
        lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
 
+#if !ENABLE_BUSYBOX
+       if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
+               argv++;
+#endif
        applet_name = argv[0];
        if (applet_name[0] == '-')
                applet_name++;