libbb/md5: code shrink
[oweals/busybox.git] / libbb / appletlib.c
index 6f058bcc80f579990207dc8108354f1082780576..b32ff8808ca1a120ead2efd0cb92e2e079073831 100644 (file)
@@ -7,9 +7,9 @@
  * here, please feel free to acknowledge your work.
  *
  * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
- * Permission has been granted to redistribute this code under the GPL.
+ * Permission has been granted to redistribute this code under GPL.
  *
- * Licensed under GPLv2 or later, see file License in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 /* We are trying to not use printf, this benefits the case when selected
@@ -195,7 +195,11 @@ void lbb_prepare(const char *applet
 #if ENABLE_FEATURE_INDIVIDUAL
        /* Redundant for busybox (run_applet_and_exit covers that case)
         * but needed for "individual applet" mode */
-       if (argv[1] && !argv[2] && strcmp(argv[1], "--help") == 0) {
+       if (argv[1]
+        && !argv[2]
+        && strcmp(argv[1], "--help") == 0
+        && strncmp(applet, "busybox", 7) != 0
+       ) {
                /* Special case. POSIX says "test --help"
                 * should be no different from e.g. "test --foo".  */
                if (!ENABLE_TEST || strcmp(applet_name, "test") != 0)
@@ -588,9 +592,11 @@ static const char usr_sbin[] ALIGN1 = "/usr/sbin/";
 static const char *const install_dir[] = {
        &usr_bin [8], /* "/" */
        &usr_bin [4], /* "/bin/" */
-       &usr_sbin[4], /* "/sbin/" */
-       usr_bin,
-       usr_sbin
+       &usr_sbin[4]  /* "/sbin/" */
+# if !ENABLE_INSTALL_NO_USR
+       ,usr_bin
+       ,usr_sbin
+# endif
 };
 
 
@@ -651,6 +657,7 @@ static int busybox_main(char **argv)
                        "See source distribution for full notice.\n"
                        "\n"
                        "Usage: busybox [function] [arguments]...\n"
+                       "   or: busybox --list[-full]\n"
                        "   or: function [arguments]...\n"
                        "\n"
                        "\tBusyBox is a multi-call binary that combines many common Unix\n"