aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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.
* | win32: fix fnmatch(3) handling of xdigitRon Yorston2021-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The glob pattern '[[:xdigit::]]*' didn't return the matches expected. It turns out the implementation (from glibc) fails to detect 'xdigit' as a valid character class. Changing the definition of CHAR_CLASS_MAX_LENGTH to 7 fixes the problem. This was never an issue in glibc because it uses a different definition. More modern versions of fnmatch(3) in glibc and gnulib also make CHAR_CLASS_MAX_LENGTH long enough. The code for fnmatch(3) was taken from glibc at commit 7814856974388a856a575fa45f88d502c8a1ab29. This was the last version before the code was rearraged to better support multibyte characters.
* | win32: tidy up time conversionsRon Yorston2021-08-091-7/+3
| | | | | | | | | | | | | | Remove filetime_to_time_t(): it's no longer used. Align style of time{spec,val}_to_filetime() to make it easier to compare what they do.
* | win32: code shrinkRon Yorston2021-08-083-12/+11
| | | | | | | | | | | | | | | | | | Save a few bytes: - When collecting entropy prefer functions we call elsewhere. - In uname(2) set 32-bit processor type to i686 and tweak it for i386.
* | win32: improved keycode detectionRon Yorston2021-08-061-42/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In read_keys(): - Identify all keys on the numeric pad used to enter character codes. Otherwise Alt-Left/Alt-Right on the numeric pad are treated as word movements in command line editing, preventing the entry of character codes containing 4 or 6. - Add modifier flag bits to the virtual keycodes we care about. This means, for example, that only the unmodified Up/Down arrow keys move through shell history, not Up/Down plus arbitrary modifiers.
* | win32: code shrink read_key()Ron Yorston2021-08-061-11/+5
| | | | | | | | No change in functionality. Saves 16 bytes.
* | split: improve performanceRon Yorston2021-08-051-1/+7
| | | | | | | | | | | | | | | | The default buffer size doesn't seem to work very well on Windows. Increasing the buffer to 16K speeds up the splitting of a 1GB file into 100MB chunks by a factor of two. GitHub issue #224.
* | win32: better detection of Alt key releaseRon Yorston2021-08-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7874ca73b (win32: allow characters to be entered as ALTNNN) made it possible to enter characters using Alt and a character code on the numeric pad. This required detecting the release of the Alt key. Sometimes this caused a problem when using Alt+Tab to cycle between applications. If Alt was released before Tab the code passed a tab character to the application. Avoid such issues by looking specifically for the release of the Alt key.
* | ash: reset ANSI emulation at promptRon Yorston2021-08-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | It appears that MSYS2/Cygwin applications turn off virtual terminal processing. This caused literal ANSI escape sequences to be echoed in the shell, which assumed the console state it had applied would remain unchanged. Add a call to skip_ansi_emulation(TRUE) before issuing a shell prompt to ensure that the state is correct. GitHub issue #223.
* | win32: code shrink using is_prefixed_with()Ron Yorston2021-07-283-20/+27
| | | | | | | | | | | | | | Use is_prefixed_with() rather than strncmp() in a few places, and the case-insensitive analogues. Saves 96 bytes in 64-bit build, 192 bytes in 32-bit.
* | win32: code shrink has_exec_format()Ron Yorston2021-07-281-13/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In the code to detect binaries: - use '|' rather than '+' to combine bytes; - fix the test that the PE header is within the buffer; - once we have the offset to the PE header make a pointer to it; - cosmetic changes. Saves 96 bytes.
* | win32: more efficient tests for executablesRon Yorston2021-07-262-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | file_is_executable() calls access(2) and stat(2); in this case our WIN32 implementation also calls stat(2). Avoid this unnecessary duplication by copying the required test from the WIN32 access(2). In find_executable() it's possible to avoid calling file_is_executable() if add_win32_extension() returns TRUE as the latter will already have verified that the file is executable. Replace a call to file_is_executable() in the tab completion code with the equivalent tests, avoiding (up to) two calls to stat(2). These changes don't affect the size of the binary and should be faster.
* | Update READMEFRP-4264-gc79f13025Ron Yorston2021-07-251-2/+4
| |
* | win32: special case for devices files in stat(2)Ron Yorston2021-07-251-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The diff applet calls stat(2) on the files it's asked to process. This includes /dev/null when the -N flag is used and /dev/fd/* files when process substitution is used. Treat device files as a special case in get_file_attr(), returning a fake set of attributes with FILE_ATTRIBUTE_DEVICE set. This value is unused elsewhere in busybox-w32. Ensure it's unset in other cases. When FILE_ATTRIBUTE_DEVICE is set: - adjust some permissions; - avoid calling has_exec_format() as this opens/closes the file which breaks process substitution. These changes improve the behaviour of diff but they also have other effects. For example, the stat and ls applets now report details of device files. There may be unintended consequences.
* | Update default configurationRon Yorston2021-07-242-4/+4
| | | | | | | | | | Disable ASH_OPTIMIZE_FOR_SIZE to pick up the ${v//pattern/repl} speed up.