[git commit] fix [ --help ] and [[ --help ]]

Denys Vlasenko vda.linux at googlemail.com
Tue Aug 30 15:12:34 UTC 2022


commit: https://git.busybox.net/busybox/commit/?id=dd79e1d4d3b9725e927d1c26e0d3fdb49e29ba9c
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
show_usage_if_dash_dash_help                          72      79      +7

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/appletlib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index 9b9d7dbd6..d5335d353 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -937,6 +937,9 @@ void FAST_FUNC show_usage_if_dash_dash_help(int applet_no, char **argv)
 #  endif
 #  if defined APPLET_NO_echo
 	 && applet_no != APPLET_NO_echo
+#  endif
+#  if ENABLE_TEST1 || ENABLE_TEST2
+	 && argv[0][0] != '[' /* exclude [ --help ] and [[ --help ]] too */
 #  endif
 	) {
 		if (argv[1] && strcmp(argv[1], "--help") == 0) {


More information about the busybox-cvs mailing list