aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * awk: fix backslash handling in sub() builtinsDenys Vlasenko2023-06-032-22/+66
| | | | | | | | | | | | | | function old new delta awk_sub 559 544 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix precedence of = relative to ==Denys Vlasenko2023-05-302-21/+50
| | | | | | | | | | | | | | | | | | | | | | | | Discovered while adding code to disallow assignments to non-lvalues function old new delta parse_expr 936 991 +55 .rodata 105243 105247 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 59/0) Total: 59 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tunctl: code shrinkDenys Vlasenko2023-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | function old new delta .rodata 105246 105243 -3 tunctl_main 349 344 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-8) Total: -8 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: printf(INVALID_FMT) prints it verbatimDenys Vlasenko2023-05-291-3/+9
| | | | | | | | | | | | | | function old new delta awk_printf 628 640 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: shrink - use setvar_sn() to set variables from non-NUL terminated stringsDenys Vlasenko2023-05-281-14/+9
| | | | | | | | | | | | | | | | | | | | | | function old new delta setvar_sn - 39 +39 exec_builtin 1145 1136 -9 awk_getline 591 559 -32 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 39/-41) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: code shrinkDenys Vlasenko2023-05-281-23/+24
| | | | | | | | | | | | | | function old new delta awk_getline 620 591 -29 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix closing of non-opened fileDenys Vlasenko2023-05-281-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta setvar_ERRNO - 53 +53 .rodata 105252 105246 -6 awk_getline 639 620 -19 evaluate 3402 3377 -25 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 53/-50) Total: 3 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/dump: code shrinkDenys Vlasenko2023-05-281-5/+7
| | | | | | | | | | | | | | function old new delta .rodata 105252 105246 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: do not read ARGIND, only set it (gawk compat)Denys Vlasenko2023-05-271-5/+14
| | | | | | | | | | | | | | | | | | | | | | function old new delta next_input_file 216 243 +27 evaluate 3396 3402 +6 awk_main 826 829 +3 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 36/0) Total: 36 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: remove a local variable "caching" a struct memberDenys Vlasenko2023-05-271-6/+4
| | | | | | | | | | | | | | | | | | | | Since we take its address, the variable lives on stack (not a GPR). Thus, nothing is improved by caching it. function old new delta awk_getline 642 639 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: get rid of one indirection level for iF (input file structure)Denys Vlasenko2023-05-271-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta try_to_assign - 91 +91 next_input_file 214 216 +2 awk_main 827 826 -1 evaluate 3403 3396 -7 is_assignment 91 - -91 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/2 up/down: 93/-99) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix splitting with default FSDenys Vlasenko2023-05-272-5/+15
| | | | | | | | | | | | | | function old new delta awk_split 543 544 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/dump: make xxd_displayoff member conditional on xxdDenys Vlasenko2023-05-272-6/+14
| | | | | | | | | | | | | | | | | | With xxd not selected: function old new delta display 1459 1444 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: -l,I,L indeed depend on sizeof(long), fix thisDenys Vlasenko2023-05-263-29/+39
| | | | | | | | | | | | | | | | | | | | 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>
| * awk: fix use-after-realloc (CVE-2021-42380), closes 15601Denys Vlasenko2023-05-262-6/+75
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hexdump: code shrinkDenys Vlasenko2023-05-261-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * hexdump, xxd: shrink stringsDenys Vlasenko2023-05-262-11/+11
| | | | | | | | | | | | | | | | | | | | 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>
| * libbb/dump: correct handling of 1-byte signed int formatDenys Vlasenko2023-05-262-21/+50
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb/dump: use fputs_stdout where appropriateDenys Vlasenko2023-05-261-2/+2
| | | | | | | | | | | | | | function old new delta display 1485 1483 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od, hexdump: byte 0x11 is "dc1" not "dcl"Denys Vlasenko2023-05-263-9/+45
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: actually remove -IL from --help, as comment saysDenys Vlasenko2023-05-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: support -DOHXILDenys Vlasenko2023-05-263-45/+46
| | | | | | | | | | | | | | | | | | | | 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>
| * libbb/dump: conditionalize code used only by xxd and odDenys Vlasenko2023-05-263-2/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: fix default format, shrinkDenys Vlasenko2023-05-262-20/+32
| | | | | | | | | | | | | | | | | | | | 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>
| * od: stop printing extra trailing spacesDenys Vlasenko2023-05-254-47/+51
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * od: implement -BDenys Vlasenko2023-05-252-15/+15
| | | | | | | | | | | | | | | | | | | | 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>
| * od: correct -i, enable tests which pass for DESKTOP tooDenys Vlasenko2023-05-253-31/+39
| | | | | | | | | | | | | | function old new delta .rodata 105302 105305 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: for !DESKTOP, match output more closely to GNU coreutils 9.1, implement -sDenys Vlasenko2023-05-253-68/+100
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * od: add testsDavid Leonard2023-05-252-0/+220
| | | | | | | | | | | | | | | | * 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>
| * od: fix -ODavid Leonard2023-05-251-1/+1
| | | | | | | | | | | | | | | | 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>
| * hush: make "false" built-inDenys Vlasenko2023-05-251-0/+7
| | | | | | | | | | | | | | | | | | | | 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>
| * hush: fix ELIF cmd1;cmd2 THEN ... not executing cmd2, closes 15571Denys Vlasenko2023-05-259-8/+56
| | | | | | | | | | | | | | function old new delta run_list 1012 1024 +12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Fix for old mingw-w64 (32-bit)Ron Yorston2023-06-151-0/+3
| | | | | | | | | | | | It appears that RtlGenRandom() wasn't supported in 32-bit builds using mingw-w64 until version 7.0.0 (Fedora 33). Use the time to initialise the PRNG in earlier versions.
* | Fixes for old mingw-w64Ron Yorston2023-06-143-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Allow current busybox-w32 to build with the CentOS 6 version of mingw-w64. - Fix declaration of setlinebuf(). (GitLab issue 116) - Define ENABLE_VIRTUAL_TERMINAL_INPUT. (GitLab issue 117) - Define IO_REPARSE_TAG_APPEXECLINK. - Avoid a compiler warning in coreutils/shuf.c.
* | make: code shrinkRon Yorston2023-06-081-1/+1
| | | | | | | | Saves 8 bytes in the 32-bit build.
* | ls: code shrinkRon Yorston2023-06-071-10/+11
| |
* | ls: check whether link is hiddenRon Yorston2023-06-061-0/+17
| | | | | | | | | | | | | | | | | | | | When using 'ls -L' to list the target of a symlink (or equivalent) we must first check whether the link itself is hidden and thus subject to special treatment by the '-a' or '-A' options. Adds 80 bytes. (GitHub issue #331)
* | win32: remove special treatment of USERNAMERon Yorston2023-06-052-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 255ebaf535 (drop: adjust environment on privilege change) added USERNAME to the variables subject to special treatment when the shell starts or privilege is dropped. It's been pointed out this may not be appropriate for a variable that's Windows-specific. Remove the special treatment of USERNAME. Saves 40-48 bytes. (GitHub issue #300)
* | win32: code shrink applet look-upRon Yorston2023-06-053-31/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove find_preferred_applet_by_name(). Instead add a reference to is_applet_preferred() in find_applet_by_name(). - Remove the global variable ash_path. Use a static instead, accessed by calling get_ash_path(). - Mark ash_applet_by_name() as NOINLINE. Saves 64-96 bytes. (GitHub issue #329)
* | Example build scriptsRon Yorston2023-06-043-0/+124
| | | | | | | | | | | | Supply the scripts used to build release and prerelease busybox-w32. (GitHub issue #330)
* | win32: code shrinkRon Yorston2023-06-041-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getsysdir() wasn't used in get_proc_addr() because the former called realpath() which in turn called the latter. (Commit 4c6c8d61bc) realpath() was used to adjust the case of the path name as it was visible to the user as root's home directory. (Commit b04bbc0109) Later the home directory for "root" was changed so it no longer needed getsysdir(). (Commit 385decd6bf) The remaining uses of getsysdir() don't require the path to be canonicalised, so realpath() can be removed from getsysdir() and getsysdir() can be used in get_proc_addr(). Saves 32-64 bytes
* | ash: fix build with line editing disabledRon Yorston2023-06-041-0/+4
| | | | | | | | | | | | | | | | | | Commit 64c8f5f3d0 (ash: add support for INT trap) made some changes to the line editing code. As a result building the shell with line editing disabled fails. Add the necessary conditional compilation to restore the ability to do this.
* | win32: another BB_OVERRIDE_APPLETS fixRon Yorston2023-06-043-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support for conditionally replacing applets with external commands requires the ability to check whether a given command name is present on PATH. This was being done using the PATH environment variable, which works in commands run by the shell but not in the shell itself. - The shell uses the *shell* variable PATH to look for executables. This may not be the same as the *environment* variable. - 'command -p' uses an entirely different PATH. Applet look-up in the shell is now treated as a special case, with the actual PATH being used passed to the look-up code in a global variable. This doesn't affect tab completion in the shell: whether a completion is an applet or an external command is irrelevant. Costs 152-288 bytes. (GitHub issue #329)
* | win32: fix BB_OVERRIDE_APPLETSRon Yorston2023-06-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | Now that BB_OVERRIDE_APPLETS can affect how the shell searches PATH it may be necessary to invalidate the command table when it changes. It's probably not worth being clever about this: just invalidate the cache on every change. Adds 40-80 bytes (GitHub issue #329)
* | win32: change interpretation of BB_OVERRIDE_APPLETSRon Yorston2023-06-022-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the following changes to BB_OVERRIDE_APPLETS: - Applet names in the list can be separated by spaces, commas or semicolons. - Applets before the first semicolon are disabled unconditionally. - Applets after the first semicolon are overridden if a matching external command exists. - '-' alone disables all applets. - '+' alone overrides every applet for which a matching external command exists. This doesn't change the existing documented behaviour. It adds the ability to have applets overridden if an external command exists but to remain available if not. Adds 80-88 bytes. (GitHub issue #329)
* | win32: fix euro symbol handlingRon Yorston2023-06-022-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | Commit 2b4dbe5fa (libbb: speed up bb_get_chunk_from_file()) speeded up grep by a factor of two. However, it introduced a call to OemToCharBuff() in bb_get_chunk_from_file() which didn't have the fix for the euro symbol from commit 93a63809f9 (win32: add support for the euro currency symbol). Export the fixed version of OemToCharBuff() and use it. Saves 8 bytes (64-bit), adds 28 bytes (32-bit)
* | win32: skip test for non-console apps if necessaryRon Yorston2023-06-021-0/+4
| | | | | | | | | | | | | | | | | | Commit 20b6a57af (win32: crtl-c interrupts non-console applications) introduced a test for non-console apps in the Ctrl-C handler. Skip this if GetConsoleProcessList() isn't available. Costs 68-88 bytes.
* | Update READMERon Yorston2023-06-021-4/+5
| |
* | ls: allow hidden system files to be omittedRon Yorston2023-06-011-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'ls' applet in busybox-w32 treated files with the hidden attribute as though they had a leading '.'. Some such files also have the system attribute set. Since these aren't of much interest to most users and since several of them have long unsightly names there's some advantage in allowing them to be omitted from the listing. Implement this by omitting hidden system files if the '-a' or '-A' option is given twice. Adds 80-88 bytes (GitHub issue #328)
* | ash: enable 'set -/+o noconsole'Ron Yorston2023-06-013-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the 'noconsole' shell option could only be set as a shell command line option. Allow it to be changed from within the shell by 'set -o noconsole' or 'set +o noconsole'. The console window is now minimised rather than hidden. This makes it easier for the user to access the console when 'noconsole' is in effect. Adds 8-32 bytes. (GitHub issue #325)