X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=applets.c;h=10b44a5fc7250a930869e685df13bf31e5daed4e;hb=a2a978ae23e267c24eb7b11662afdcc9ea47e789;hp=1e31e89259917ec8f7f90e756d0838505b56ef26;hpb=aad1a88c76f208d188fd061e3723bd637437e8d5;p=oweals%2Fbusybox.git diff --git a/applets.c b/applets.c index 1e31e8925..10b44a5fc 100644 --- a/applets.c +++ b/applets.c @@ -27,19 +27,35 @@ #include #include +#include #include "busybox.h" +#undef APPLET +#undef APPLET_NOUSAGE +#undef PROTOTYPES +#include "applets.h" + #define bb_need_full_version #define BB_DECLARE_EXTERN #include "messages.c" struct BB_applet *applet_using; +/* The -1 arises because of the {0,NULL,0,-1} entry above. */ +const size_t NUM_APPLETS = (sizeof (applets) / sizeof (struct BB_applet) - 1); + extern void show_usage(void) { const char *format_string; const char *usage_string = usage_messages; int i; + /* From busybox.c */ + extern int been_there_done_that; + + if (strcmp(applet_using->name, "busybox")==0) { + been_there_done_that=1; + busybox_main(0, NULL); + } for (i = applet_using - applets; i > 0; ) { if (!*usage_string++) {