aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/usage_pod.c2
-rw-r--r--docs/busybox_footer.pod2
-rw-r--r--libbb/appletlib.c30
3 files changed, 19 insertions, 15 deletions
diff --git a/applets/usage_pod.c b/applets/usage_pod.c
index 0b1c4aadb..ccc166aed 100644
--- a/applets/usage_pod.c
+++ b/applets/usage_pod.c
@@ -90,6 +90,8 @@ int main(void)
90 printf("%s\n\n", usage_array[i].aname); 90 printf("%s\n\n", usage_array[i].aname);
91 } 91 }
92 } 92 }
93 printf("=back\n\n");
94
93 return 0; 95 return 0;
94} 96}
95 97
diff --git a/docs/busybox_footer.pod b/docs/busybox_footer.pod
index c346c736b..92748eb72 100644
--- a/docs/busybox_footer.pod
+++ b/docs/busybox_footer.pod
@@ -1,5 +1,3 @@
1=back
2
3=head1 LIBC NSS 1=head1 LIBC NSS
4 2
5GNU Libc (glibc) uses the Name Service Switch (NSS) to configure the behavior 3GNU Libc (glibc) uses the Name Service Switch (NSS) to configure the behavior
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 791b81c17..c341817e2 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -841,6 +841,7 @@ static int busybox_main(char **argv)
841} 841}
842# endif 842# endif
843 843
844# if NUM_APPLETS > 0
844void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv) 845void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
845{ 846{
846 int argc = 1; 847 int argc = 1;
@@ -858,15 +859,15 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
858 * "true" and "false" are also special. 859 * "true" and "false" are also special.
859 */ 860 */
860 if (1 861 if (1
861#if defined APPLET_NO_test 862# if defined APPLET_NO_test
862 && applet_no != APPLET_NO_test 863 && applet_no != APPLET_NO_test
863#endif 864# endif
864#if defined APPLET_NO_true 865# if defined APPLET_NO_true
865 && applet_no != APPLET_NO_true 866 && applet_no != APPLET_NO_true
866#endif 867# endif
867#if defined APPLET_NO_false 868# if defined APPLET_NO_false
868 && applet_no != APPLET_NO_false 869 && applet_no != APPLET_NO_false
869#endif 870# endif
870 ) { 871 ) {
871 if (argc == 2 && strcmp(argv[1], "--help") == 0) { 872 if (argc == 2 && strcmp(argv[1], "--help") == 0) {
872 /* Make "foo --help" exit with 0: */ 873 /* Make "foo --help" exit with 0: */
@@ -878,19 +879,22 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, char **argv)
878 check_suid(applet_no); 879 check_suid(applet_no);
879 exit(applet_main[applet_no](argc, argv)); 880 exit(applet_main[applet_no](argc, argv));
880} 881}
882# endif /* NUM_APPLETS > 0 */
881 883
882static NORETURN void run_applet_and_exit(const char *name, char **argv) 884static NORETURN void run_applet_and_exit(const char *name, char **argv)
883{ 885{
884 int applet;
885
886# if ENABLE_BUSYBOX 886# if ENABLE_BUSYBOX
887 if (is_prefixed_with(name, "busybox")) 887 if (is_prefixed_with(name, "busybox"))
888 exit(busybox_main(argv)); 888 exit(busybox_main(argv));
889# endif 889# endif
890# if NUM_APPLETS > 0
890 /* find_applet_by_name() search is more expensive, so goes second */ 891 /* find_applet_by_name() search is more expensive, so goes second */
891 applet = find_applet_by_name(name); 892 {
892 if (applet >= 0) 893 int applet = find_applet_by_name(name);
893 run_applet_no_and_exit(applet, argv); 894 if (applet >= 0)
895 run_applet_no_and_exit(applet, argv);
896 }
897# endif
894 898
895 /*bb_error_msg_and_die("applet not found"); - links in printf */ 899 /*bb_error_msg_and_die("applet not found"); - links in printf */
896 full_write2_str(applet_name); 900 full_write2_str(applet_name);
@@ -957,10 +961,10 @@ int main(int argc UNUSED_PARAM, char **argv)
957#else 961#else
958 lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv)); 962 lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv));
959 963
960#if !ENABLE_BUSYBOX 964# if !ENABLE_BUSYBOX
961 if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox")) 965 if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox"))
962 argv++; 966 argv++;
963#endif 967# endif
964 applet_name = argv[0]; 968 applet_name = argv[0];
965 if (applet_name[0] == '-') 969 if (applet_name[0] == '-')
966 applet_name++; 970 applet_name++;