summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-27libbb/dump: make xxd_displayoff member conditional on xxdDenys Vlasenko
With xxd not selected: function old new delta display 1459 1444 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26od: -l,I,L indeed depend on sizeof(long), fix thisDenys Vlasenko
function old new delta .rodata 105255 105252 -3 od_main 1917 1901 -16 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-19) Total: -19 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26awk: fix use-after-realloc (CVE-2021-42380), closes 15601Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26hexdump: code shrinkDenys Vlasenko
function old new delta add_format - 50 +50 add_first 10 - -10 hexdump_main 401 366 -35 .rodata 105306 105255 -51 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 0/2 up/down: 50/-96) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26hexdump, xxd: shrink stringsDenys Vlasenko
function old new delta add_first 12 10 -2 .rodata 105321 105306 -15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-17) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26libbb/dump: correct handling of 1-byte signed int formatDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26libbb/dump: use fputs_stdout where appropriateDenys Vlasenko
function old new delta display 1485 1483 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26od, hexdump: byte 0x11 is "dc1" not "dcl"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26od: actually remove -IL from --help, as comment saysDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26od: support -DOHXILDenys Vlasenko
function old new delta od_main 1866 1917 +51 .rodata 105306 105321 +15 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 66/0) Total: 66 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26libbb/dump: conditionalize code used only by xxd and odDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-26od: fix default format, shrinkDenys Vlasenko
function old new delta od_main 556 568 +12 .rodata 104613 104555 -58 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 12/-58) Total: -46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: stop printing extra trailing spacesDenys Vlasenko
function old new delta .rodata 104598 104613 +15 display 1475 1485 +10 od_main 549 556 +7 rewrite 971 967 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 32/-4) Total: 28 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: implement -BDenys Vlasenko
function old new delta .rodata 105305 105306 +1 od_main 1880 1866 -14 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 1/-14) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: correct -i, enable tests which pass for DESKTOP tooDenys Vlasenko
function old new delta .rodata 105302 105305 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: for !DESKTOP, match output more closely to GNU coreutils 9.1, implement -sDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: add testsDavid Leonard
* Added tests for od (non-DESKTOP little-endian) * Allow 'optional' to invert meaning of a config option with '!' Signed-off-by: David Leonard <d+busybox@adaptive-enterprises.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25od: fix -ODavid Leonard
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>
2023-05-25hush: make "false" built-inDenys Vlasenko
function old new delta bltins1 384 396 +12 builtin_false - 6 +6 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/0 up/down: 18/0) Total: 18 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-25hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571Denys Vlasenko
function old new delta run_list 1012 1024 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-18ash: use-after-free in bash pattern substitutionKarsten Sperling
Commit daa66ed6 fixed a number of use-after-free bugs in bash pattern substitution, however one "unguarded" STPUTC remained, which is fixed here. function old new delta subevalvar 1564 1576 +12 Signed-off-by: Karsten Sperling <ksperling@apple.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-18examples/var_service/README: fix an errorDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-09cpio: tweak --helpDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-09nslookup: code shrinkDenys Vlasenko
function old new delta send_queries 725 723 -2 nslookup_main 822 820 -2 add_query 89 86 -3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-7) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-09nslookup: ensure unique transaction IDs for the DNS queriesDenys Vlasenko
Based on patch by Uwe Kleine-König. It makes sense to actually see the nitty-gritty details of DNS querying, so bringing in (commented-out) musl's DNS request code. function old new delta nslookup_main 760 822 +62 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-09hush: add comment about abort on syntax error %{^}Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-08build system: fix "Config.in:117 error: Overlong line"Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-08hush: fix an interactive abort on errorDenys Vlasenko
function old new delta parse_and_run_stream 140 155 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-07build system: Make it possible to build with 64bit time_tUwe Kleine-König
On most 32bit architectures time_t (and a few other time related types) are a signed 32bit wide integer type. As a consequence they can only represent dates between Fri Dec 13 08:45:52 PM UTC 1901 (-0x80000000 seconds before Jan 1 1970) and Tue Jan 19 03:14:07 AM UTC 2038 (0x7fffffff seconds after Jan 1 1970). Given that some machines that are built today have an expected lifetime of >15 years, this needs to be extended. To to that, define the cpp symbol _TIME_BITS to 64 which results in some magic in glibc to make time_t (and the few other time related types) 64 bit wide. This new switch CONFIG_TIME64 is in the spirit of CONFIG_LFS and only expected to have the expected effect with glibc. On musl for examples time_t already defaults to 64bit wide types. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-07readlink: code shrinkDenys Vlasenko
function old new delta readlink_main 111 103 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-05-07nmeter: improve %T fractionals displayDenys Vlasenko
function old new delta nmeter_main 751 786 +35 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-23factor: we can pack 21, not 20, 3-bit elements into packed wheel wordsDenys Vlasenko
function old new delta packed_wheel 192 184 -8 factor_main 171 163 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-16) Total: -16 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-23ip: code shrinkDenys Vlasenko
function old new delta ipaddr_list_or_flush 1089 1079 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-16readlink: support --, -n alwaysEric Blake
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>
2023-04-16tr: display usage for incorrect argumentsRon Yorston
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>
2023-04-16ash,hush: tab completion of functions and aliasesRon Yorston
Since commit 9e2a5668f (ash,hush: allow builtins to be tab-completed, closes 7532) ash and hush have supported tab completion of builtins. Other shells, bash and ksh for example, also support tab completion of functions and aliases. Add such support to ash and hush. function old new delta ash_command_name - 92 +92 hush_command_name - 63 +63 ash_builtin_name 17 - -17 hush_builtin_name 38 - -38 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/0 up/down: 169/-55) Total: 100 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Avi Halachmi <avihpit@yahoo.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-13hush: quote variable values printed by "set" (match ash behavior)Denys Vlasenko
function old new delta builtin_set 258 301 +43 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-13shuf: another tweak to COMMON_PREFIX_HACK codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-12build system: clean more files on make cleanTomas Paukrt
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2023-04-12shuf: fix pfx_len calculationDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-12shuf: remove redundant codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-12shuf: add (disabled) code to support very long numbers in -i LO-HIDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-12lineedit: fix crash when icanon set with -echoAkos Somfai
When icanon is set with -echo (e.g. ssh from an emacs shell) then S.state will remain null but later it will be deferenced causing ash to crash. Fix: additional check on state. Signed-off-by: Akos Somfai <akos.somfai@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-12sleep: fix error exit when called as "sh" builtinDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-11seq: fix yet another case of negative parameters not workingDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-11seedrng: fix for glibc <= 2.24 not providing random headerThomas Devoogdt
- dropped the wrong define (not sure why it was there) - <sys/random.h> not available if glibc <= 2.24 - GRND_NONBLOCK not defined if <sys/random.h> not included - ret < 0 && errno == ENOSYS has to be true to get creditable set Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10seedrng: fix for glibc <= 2.24 not providing getrandom()Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10appletlib: fix "warning: unused variable applet_no"Tomas Paukrt
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10ash: fix sleep built-in not running INT trap immediately on ^CDenys Vlasenko
function old new delta sleep_for_duration 169 149 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2023-04-10mkfs_vfat: do not generate same volume_id when run in rapid successionDenys Vlasenko
function old new delta mkfs_vfat_main 1502 1523 +21 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>