From dash:
From: herbert <herbert@gondor.apana.org.au>
Date: Wed, 2 Mar 2005 22:14:54 +1100
Invert return value of test_eaccess and rename it to test_st_mode.
function old new delta
nexpr 800 766 -34
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The 'timeout' applet uses parse_duration_str() to obtain its
timeout values. The default configuration enables float durations.
However, the applet silently ignores fractional seconds. This
results in unexpected behaviour:
$ timeout 5.99 sleep 5.1; echo $?
Terminated
143
When float durations are enabled ensure that any fractional seconds
are taken into account.
function old new delta
timeout_wait 44 92 +48
timeout_main 383 365 -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-18) Total: 30 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
The coreutils versions of md5sum and the like accept uppercase hex
strings from checksum files specified with the '-c' option.
Use a case-insensitive comparison so BusyBox does the same.
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Although "naive" counting function is not too slow and is smaller,
using it on e.g. each of 1024 words of CPU mask feels wrong.
function old new delta
bb_popcnt_32 - 52 +52
get_prefix 323 321 -2
nproc_main 206 199 -7
d4_run_script 739 731 -8
ipcalc_main 533 507 -26
------------------------------------------------------------------------------
(add/remove: 2/0 grow/shrink: 0/4 up/down: 52/-43) Total: 9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
4c20d9f2b removed FEATURE_FLOAT_SLEEP option, thus since then there are
only two variants.
Fixes: 4c20d9f2b ("extend fractional duration support to "top -d N.N" and "timeout"")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Since Linux 2.2.13, chown(2) resets the suid/gid bits for all users.
This patch changes the ordering so that chmod gets called after chown.
This behavior follows GNU coreutils.
Signed-off-by: Nero <nero@w1r3.net>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
When the input data contained a cycle it was possible for tsort to
attempt to access freed nodes. This sometimes resulted in the
test case 'echo a b b a | tsort' crashing.
Don't free nodes when they're removed from the graph.
function old new delta
tsort_main 621 596 -25
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-25) Total: -25 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
od with option -O (4-byte octal) was incorrectly displaying 2-byte
decimal when built without CONFIG_DESKTOP
Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
POSIX will be standardizing readlink (just the -n option) and realpath
(just -E and -e options):
https://www.austingroupbugs.net/view.php?id=1457
Change things for readlink so that the POSIX-mandated -n and -- work
even when disabling the non-standard (and partially non-working) -f
when FEATURE_READLINK_FOLLOW is clear.
POSIX also wants readlink to be verbose by default (if the argument is
not a symlink, readlink must output a diagnostic); I did NOT address
that one, because I'm waiting to see what the GNU Coreutils folks do:
https://lists.gnu.org/archive/html/bug-coreutils/2023-03/msg00035.html
Partial fix for https://bugs.busybox.net/show_bug.cgi?id=15466
function old new delta
packed_usage 34538 34557 +19
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
tr must have one or two non-option arguments. Display the usage
message if any other number is present.
function old new delta
.rodata 108389 108392 +3
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 3/0) Total: 3 bytes
Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Various tools are Linuxish and should thus only attempted to build on
Linux only. Some features are also Linux-only.
Also, libresolv is used on all GNU platforms, notably GNU/Hurd and
GNU/kfreeBSD.
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>