From 253f555f01fa380083a7436a569397a4e7f997b0 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 9 Jul 2018 18:23:33 +0200 Subject: 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 --- libbb/appletlib.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libbb/appletlib.c') 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) else { full_write2_str("\nUsage: "); full_write2_str(applet_name); - full_write2_str(" "); - full_write2_str(p); + if (p[0]) { + if (p[0] != '\n') + full_write2_str(" "); + full_write2_str(p); + } full_write2_str("\n"); } if (ENABLE_FEATURE_CLEAN_UP) -- cgit v1.2.3