From ea023eacad23f6a30cffe4f255a050b91748fc2f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 26 Jan 2011 01:21:20 +0100 Subject: disable length applet. ${#var} and echo -n "$var" | wc -c are portable equivalents Signed-off-by: Denys Vlasenko --- TEST_config_nommu | 1 - TEST_config_noprintf | 1 - TEST_config_rh9 | 1 - coreutils/Config.src | 10 +++++----- coreutils/Kbuild.src | 2 +- coreutils/length.c | 22 ---------------------- coreutils/length.c.disabled | 22 ++++++++++++++++++++++ include/applets.src.h | 2 +- 8 files changed, 29 insertions(+), 32 deletions(-) delete mode 100644 coreutils/length.c create mode 100644 coreutils/length.c.disabled diff --git a/TEST_config_nommu b/TEST_config_nommu index 18f4483..905f652 100644 --- a/TEST_config_nommu +++ b/TEST_config_nommu @@ -189,7 +189,6 @@ CONFIG_HOSTID=y CONFIG_ID=y CONFIG_INSTALL=y CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y -CONFIG_LENGTH=y CONFIG_LN=y CONFIG_LOGNAME=y CONFIG_LS=y diff --git a/TEST_config_noprintf b/TEST_config_noprintf index 22525ec..b72e128 100644 --- a/TEST_config_noprintf +++ b/TEST_config_noprintf @@ -211,7 +211,6 @@ CONFIG_FALSE=y # CONFIG_ID is not set # CONFIG_INSTALL is not set # CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set -# CONFIG_LENGTH is not set # CONFIG_LN is not set # CONFIG_LOGNAME is not set # CONFIG_LS is not set diff --git a/TEST_config_rh9 b/TEST_config_rh9 index e456083..23094e3 100644 --- a/TEST_config_rh9 +++ b/TEST_config_rh9 @@ -200,7 +200,6 @@ CONFIG_HOSTID=y CONFIG_ID=y CONFIG_INSTALL=y CONFIG_FEATURE_INSTALL_LONG_OPTIONS=y -CONFIG_LENGTH=y CONFIG_LN=y CONFIG_LOGNAME=y CONFIG_LS=y diff --git a/coreutils/Config.src b/coreutils/Config.src index c2fd73e..1a044f9 100644 --- a/coreutils/Config.src +++ b/coreutils/Config.src @@ -295,11 +295,11 @@ config FEATURE_INSTALL_LONG_OPTIONS help Support long options for the install applet. -config LENGTH - bool "length" - default y - help - length is used to print out the length of a specified string. +####config LENGTH +#### bool "length" +#### default y +#### help +#### length is used to print out the length of a specified string. config LN bool "ln" diff --git a/coreutils/Kbuild.src b/coreutils/Kbuild.src index 4ea0fa5..6a41c83 100644 --- a/coreutils/Kbuild.src +++ b/coreutils/Kbuild.src @@ -39,7 +39,7 @@ lib-$(CONFIG_HEAD) += head.o lib-$(CONFIG_HOSTID) += hostid.o lib-$(CONFIG_ID) += id.o lib-$(CONFIG_INSTALL) += install.o -lib-$(CONFIG_LENGTH) += length.o +#lib-$(CONFIG_LENGTH) += length.o lib-$(CONFIG_LN) += ln.o lib-$(CONFIG_LOGNAME) += logname.o lib-$(CONFIG_LS) += ls.o diff --git a/coreutils/length.c b/coreutils/length.c deleted file mode 100644 index 7f0b48c..0000000 --- a/coreutils/length.c +++ /dev/null @@ -1,22 +0,0 @@ -/* vi: set sw=4 ts=4: */ -/* - * Licensed under GPLv2, see file LICENSE in this source tree. - */ - -/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ - -#include "libbb.h" - -/* This is a NOFORK applet. Be very careful! */ - -int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; -int length_main(int argc, char **argv) -{ - if ((argc != 2) || (**(++argv) == '-')) { - bb_show_usage(); - } - - printf("%u\n", (unsigned)strlen(*argv)); - - return fflush_all(); -} diff --git a/coreutils/length.c.disabled b/coreutils/length.c.disabled new file mode 100644 index 0000000..7f0b48c --- /dev/null +++ b/coreutils/length.c.disabled @@ -0,0 +1,22 @@ +/* vi: set sw=4 ts=4: */ +/* + * Licensed under GPLv2, see file LICENSE in this source tree. + */ + +/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */ + +#include "libbb.h" + +/* This is a NOFORK applet. Be very careful! */ + +int length_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; +int length_main(int argc, char **argv) +{ + if ((argc != 2) || (**(++argv) == '-')) { + bb_show_usage(); + } + + printf("%u\n", (unsigned)strlen(*argv)); + + return fflush_all(); +} diff --git a/include/applets.src.h b/include/applets.src.h index fa7d0cc..133f376 100644 --- a/include/applets.src.h +++ b/include/applets.src.h @@ -211,7 +211,7 @@ IF_KILLALL(APPLET_ODDNAME(killall, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall)) IF_KILLALL5(APPLET_ODDNAME(killall5, kill, BB_DIR_USR_BIN, BB_SUID_DROP, killall5)) IF_KLOGD(APPLET(klogd, BB_DIR_SBIN, BB_SUID_DROP)) IF_LAST(APPLET(last, BB_DIR_USR_BIN, BB_SUID_DROP)) -IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) +//IF_LENGTH(APPLET_NOFORK(length, length, BB_DIR_USR_BIN, BB_SUID_DROP, length)) IF_LESS(APPLET(less, BB_DIR_USR_BIN, BB_SUID_DROP)) IF_SETARCH(APPLET_ODDNAME(linux32, setarch, BB_DIR_BIN, BB_SUID_DROP, linux32)) IF_SETARCH(APPLET_ODDNAME(linux64, setarch, BB_DIR_BIN, BB_SUID_DROP, linux64)) -- cgit v1.1