diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-08 11:44:30 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2026-02-08 11:45:57 +0100 |
| commit | 8424dc436a66a224b73429675a481d074fc2f8dc (patch) | |
| tree | 2f087127f6b1722273b60b63797312aba9fda428 | |
| parent | 391fdea73b73673410c5e267ec08efd45b3f38ee (diff) | |
| download | busybox-w32-8424dc436a66a224b73429675a481d074fc2f8dc.tar.gz busybox-w32-8424dc436a66a224b73429675a481d074fc2f8dc.tar.bz2 busybox-w32-8424dc436a66a224b73429675a481d074fc2f8dc.zip | |
main: !CONFIG_BUSYBOX: "busybox --OPT" is not a call to applet "-OPT"busybox
This was confusing:
$ busybox --help
-help: applet not found
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| -rw-r--r-- | libbb/appletlib.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 17216baab..403f5614f 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
| @@ -1111,8 +1111,11 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
| 1111 | 1111 | ||
| 1112 | lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv)); | 1112 | lbb_prepare("busybox" IF_FEATURE_INDIVIDUAL(, argv)); |
| 1113 | # if !ENABLE_BUSYBOX | 1113 | # if !ENABLE_BUSYBOX |
| 1114 | if (argv[1] && is_prefixed_with(bb_basename(argv[0]), "busybox")) | 1114 | if (argv[1] && argv[1][0] != '-' /* do not match "busybox --OPT" */ |
| 1115 | && is_prefixed_with(bb_basename(argv[0]), "busybox") | ||
| 1116 | ) { | ||
| 1115 | argv++; | 1117 | argv++; |
| 1118 | } | ||
| 1116 | # endif | 1119 | # endif |
| 1117 | applet_name = argv[0]; | 1120 | applet_name = argv[0]; |
| 1118 | if (applet_name[0] == '-') | 1121 | if (applet_name[0] == '-') |
