aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* win32: code shrinkRon Yorston2021-08-271-0/+2
| | | | | | | | Turn off the 'if-conversion' optimisation for err_win_to_posix(). My tests actually have this being slightly faster than with the optimisation enabled, though within the variation of the measurement. Saves 288 bytes.
* vi: skip permission check on .exrcRon Yorston2021-08-221-0/+4
| | | | | POSIX requires that the .exrc file is only writable by its owner. Our bogus permissions can't confirm this so just skip the test.
* Merge branch 'busybox' into mergeRon Yorston2021-08-229-142/+194
|\
| * vi: code shrink print_literal()Ron Yorston2021-08-221-17/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the function print_literal() which is used to format a string that may contain unprintable characters or control characters. - Unprintable characters were being displayed in normal text rather than the bold used for the rest of the message. This doesn't seem particularly helpful and it upsets the calculation of the width of the message in show_status_line(). Use '?' rather than '.' for unprintable characters. - Newlines in the string were displayed as both '^J' and '$', which is somewhat redundant. function old new delta not_implemented 199 108 -91 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-91) Total: -91 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: searches in colon commands should wrapRon Yorston2021-08-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The '/' and '?' search commands wrap to the other end of the buffer if the search target isn't found. When searches are used to specify addresses in colon commands they should do the same. (In traditional vi and vim this behaviour is controlled by the 'wrapscan' option. BusyBox vi doesn't have this option and always uses the default behaviour.) function old new delta colon 4033 4077 +44 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 44/0) Total: 44 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * rev: correct output for long input linesRon Yorston2021-08-222-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input buffer is initialised to a reasonable size and extended if necessary. When this happened the offset into the buffer wasn't reset to zero so subsequent lines were appended to the long line. Fix this and add some tests. function old new delta rev_main 377 368 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-9) Total: -9 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar,smemcap: commonalyze checksumming code for tar headerDenys Vlasenko2021-08-204-44/+39
| | | | | | | | | | | | | | | | | | | | | | function old new delta chksum_and_xwrite_tar_header - 99 +99 writeheader 280 199 -81 chksum_and_xwrite 102 - -102 ------------------------------------------------------------------------------ (add/remove: 2/1 grow/shrink: 0/1 up/down: 99/-183) Total: -84 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: don't right shift empty linesRon Yorston2021-08-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The right shift command ('>') shouldn't affect empty lines. function old new delta do_cmd 4860 4894 +34 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 34/0) Total: 34 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: support ~/.exrcRon Yorston2021-08-201-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run initialisation commands from ~/.exrc. As with EXINIT these commands are processed before the first file is loaded. Commands starting with double quotes are ignored. This is how comments are often included in .exrc. function old new delta vi_main 268 406 +138 colon 4033 4071 +38 .rodata 108411 108442 +31 packed_usage 34128 34118 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 207/-10) Total: 197 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: changes to handling of -c and EXINITRon Yorston2021-08-201-58/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite handling of command line arguments so any number of -c commands will be processed. Previously only two -c commands were allowed (or one if EXINIT was set). Process commands from EXINIT before the first file is read into memory, as specified by POSIX. function old new delta run_cmds - 77 +77 .rodata 108410 108411 +1 vi_main 305 268 -37 edit_file 816 764 -52 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 78/-89) Total: -11 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcp: fix build breakage on MIPSDenys Vlasenko2021-08-201-12/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Start 1.35.0 development cycleDenys Vlasenko2021-08-191-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Bump version to 1.34.01_34_0Denys Vlasenko2021-08-191-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2021-08-1740-59/+301
|\|
| * scripts/randomtest.loop: let user know about SKIP_MOUNT_MAND_TESTSDenys Vlasenko2021-08-161-3/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fdisk: indentation fixDenys Vlasenko2021-08-161-4/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * busybox: fix "busybox --help busybox" not showing correct textDenys Vlasenko2021-08-161-1/+5
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * awk: fix testsuiteDenys Vlasenko2021-08-161-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix compile-time error if !ENABLE_FEATURE_VI_SETOPTSDenys Vlasenko2021-08-161-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: fix testsuiteDenys Vlasenko2021-08-161-7/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: tweak --helpDenys Vlasenko2021-08-151-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: fix testsuiteDenys Vlasenko2021-08-151-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * *: remove remains of FEATURE_TOUCH_NODEREFDenys Vlasenko2021-08-153-5/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * taskset: disallow "taskset -p 0"Denys Vlasenko2021-08-151-2/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * touch: fix SEGV if !ENABLE_FEATURE_TOUCH_SUSV3Denys Vlasenko2021-08-151-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cut: fix testsuiteDenys Vlasenko2021-08-151-0/+2
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix "error: invalid preprocessing directive ##"Denys Vlasenko2021-08-151-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * traceroute: fix compile error due to FreeBSD compatDenys Vlasenko2021-08-151-1/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * cp: fix build failure with long options disabledRon Yorston2021-08-151-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When long options were disabled cp failed to compile with: coreutils/cp.c:130:9: error: empty enum is invalid 130 | }; | ^ Rearrange the conditional compilation to suit. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: exclude files before updating hardlink info listHarald van Dijk2021-08-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | When excluding one file, and including another file that is a hardlink of the excluded file, it should be stored as an ordinary file. function old new delta writeFileToTarball 489 493 +4 Signed-off-by: Harald van Dijk <harald@gigawatt.nl> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * tar: simplify addition of --exclude=GLOB to the expansion of -X EXCLFILEDenys Vlasenko2021-08-021-6/+7
| | | | | | | | | | | | | | function old new delta tar_main 1115 1105 -10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: tweak ${var/pattern/repl} optimizationDenys Vlasenko2021-07-271-5/+4
| | | | | | | | | | | | | | function old new delta expand_one_var 2507 2502 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: optimize ${var/pattern/repl} for trivial patternsDenys Vlasenko2021-07-272-2/+14
| | | | | | | | | | | | | | function old new delta expand_one_var 2353 2507 +154 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * shell: update psubst testcasesDenys Vlasenko2021-07-278-6/+53
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: add missed "undef"Denys Vlasenko2021-07-271-3/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: implement $'str' bashismDenys Vlasenko2021-07-267-1/+138
| | | | | | | | | | | | | | | | | | | | | | function old new delta parse_dollar_squote - 441 +441 encode_then_expand_vararg 359 380 +21 parse_stream 2252 2271 +19 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 481/0) Total: 481 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ahell: update testsuiteDenys Vlasenko2021-07-257-3/+33
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: speed up ${v//pattern/repl}Denys Vlasenko2021-07-251-7/+10
| | | | | | | | | | | | | | function old new delta subevalvar 1447 1457 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | busybox: bring help handling into line with upstreamRon Yorston2021-08-161-5/+5
| | | | | | | | | | Upstream has fixed a problem with 'busybox --help' so it's possible to remove another gratuitous divergence.
* | win32: code shrink uname(2)Ron Yorston2021-08-161-8/+4
| | | | | | | | | | | | | | If GetVersionEx() fails just assume the OS version numbers remain set to zero and print them as-is. Saves 48 bytes.
* | printf: improved error handlingRon Yorston2021-08-151-19/+23
| | | | | | | | | | | | | | | | | | | | | | | | The printf applet is NOFORK and is used to implement the printf command in ash. It should therefore be careful about handling memory allocation failures. If vasprintf() or realloc() fail the applet now carries on as best it can. This may result in some lost output but at least the shell will survive. Saves 32 bytes.
* | win32: implement utimes(2) using utimensat(2)Ron Yorston2021-08-151-38/+18
| | | | | | | | Saves 176 bytes.
* | win32: tidy up fetching of system directoryRon Yorston2021-08-141-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | Add a new function, getsysdir(), to fetch and cache the system directory. This avoids the non-intuitive use of getpwuid() in get_system_drive(). The call to GetSystemDirectory() in get_proc_addr() can't be replaced because getsysdir() calls realpath() which requires a call to get_proc_addr(). No change in the size of the binary.
* | win32: code shrinkRon Yorston2021-08-141-14/+14
| | | | | | | | | | | | | | | | | | There doesn't seem to be any need to call OpenThreadToken() in file_owner(): OpenProcessToken() should suffice. Also, tidy up gethomedir() without any change in functionality. Saves 56 bytes.
* | win32: treat devices as character special filesRon Yorston2021-08-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 15fcbd19c (win32: special case for devices files in stat(2)) added special treatment in stat(2) for device files. As a result of this change device files appeared to be regular files which broke the use of /dev/null with noclobber in the shell. Device files now appear as character special files (as they do on Unix). GitHub issue #225.
* | find_mount_point: code shrinkRon Yorston2021-08-121-8/+2
| | | | | | | | | | | | | | Use xrealloc_getcwd_or_warn() instead of a hand-rolled WIN32 equivalent. Saves 84 bytes.
* | win32: better handling of nested symlinksRon Yorston2021-08-123-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our realpath(3) implementation uses xmalloc_follow_symlinks() to expand symlinks. This detects when symlinks are too deeply nested but didn't set errno, so anything calling realpath(3) was unable to say what had gone wrong. (For example, 'ls -L' or 'stat -L'.) Set errno to ELOOP. This then leads to the problem that Windows doesn't know about ELOOP so reports 'Unknown error'. Add a replacement for strerror(3) which returns a sensible message. Costs 96 bytes.
* | timeout: make child handle staticRon Yorston2021-08-111-1/+1
| |
* | nproc: code shrinkRon Yorston2021-08-101-24/+12
| | | | | | | | | | | | | | | | Avoid duplication of call to getopt(). Simplify WIN32 code. Saves 80 bytes.
* | win32: code shrink character class detectionRon Yorston2021-08-095-18/+83
| | | | | | | | | | | | | | Add a routine to detect the names of character classes. Use it in fnmatch(3) and regcomp(3), replacing local code in the former. Saves 216 bytes.