aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-07-09 18:23:33 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2018-07-09 18:23:33 +0200
commit253f555f01fa380083a7436a569397a4e7f997b0 (patch)
tree1a159d60dd48eb1d58a0b24c0900bea16362dbfb
parentcbe8c65e590949cad25dccba90101553b77d88c9 (diff)
downloadbusybox-w32-253f555f01fa380083a7436a569397a4e7f997b0.tar.gz
busybox-w32-253f555f01fa380083a7436a569397a4e7f997b0.tar.bz2
busybox-w32-253f555f01fa380083a7436a569397a4e7f997b0.zip
usage: do not print trailing space for commands which have no arguments
function old new delta bb_show_usage 120 130 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/appletlib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 769b7881c..f155d0908 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -169,8 +169,11 @@ void FAST_FUNC bb_show_usage(void)
169 else { 169 else {
170 full_write2_str("\nUsage: "); 170 full_write2_str("\nUsage: ");
171 full_write2_str(applet_name); 171 full_write2_str(applet_name);
172 full_write2_str(" "); 172 if (p[0]) {
173 full_write2_str(p); 173 if (p[0] != '\n')
174 full_write2_str(" ");
175 full_write2_str(p);
176 }
174 full_write2_str("\n"); 177 full_write2_str("\n");
175 } 178 }
176 if (ENABLE_FEATURE_CLEAN_UP) 179 if (ENABLE_FEATURE_CLEAN_UP)