aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-11-01 13:58:16 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-11-01 13:58:16 +0100
commit0575c9932d203d93633104e12054dcf5da522061 (patch)
treef6dbc96f216c5a4095eb33ca5fbc69436a743200 /libbb
parentc9e161277eae5d2af39704e220ca5652e69bc428 (diff)
downloadbusybox-w32-0575c9932d203d93633104e12054dcf5da522061.tar.gz
busybox-w32-0575c9932d203d93633104e12054dcf5da522061.tar.bz2
busybox-w32-0575c9932d203d93633104e12054dcf5da522061.zip
busybox: show embedded scripts in applet list
function old new delta busybox_main 624 642 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 92d99fbe8..d48b2ea60 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -839,24 +839,30 @@ int busybox_main(int argc UNUSED_PARAM, char **argv)
839 "Currently defined functions:\n" 839 "Currently defined functions:\n"
840 ); 840 );
841 col = 0; 841 col = 0;
842 a = applet_names;
843 /* prevent last comma to be in the very last pos */ 842 /* prevent last comma to be in the very last pos */
844 output_width--; 843 output_width--;
845 while (*a) { 844 a = applet_names;
846 int len2 = strlen(a) + 2; 845 {
847 if (col >= (int)output_width - len2) { 846# if NUM_SCRIPTS > 0
848 full_write2_str(",\n"); 847 int i;
849 col = 0; 848 for (i = 0; i < 2; i++, a = script_names)
850 } 849# endif
851 if (col == 0) { 850 while (*a) {
852 col = 6; 851 int len2 = strlen(a) + 2;
853 full_write2_str("\t"); 852 if (col >= (int)output_width - len2) {
854 } else { 853 full_write2_str(",\n");
855 full_write2_str(", "); 854 col = 0;
855 }
856 if (col == 0) {
857 col = 6;
858 full_write2_str("\t");
859 } else {
860 full_write2_str(", ");
861 }
862 full_write2_str(a);
863 col += len2;
864 a += len2 - 1;
856 } 865 }
857 full_write2_str(a);
858 col += len2;
859 a += len2 - 1;
860 } 866 }
861 full_write2_str("\n"); 867 full_write2_str("\n");
862 return 0; 868 return 0;