aboutsummaryrefslogtreecommitdiff
path: root/coreutils (follow)
Commit message (Collapse)AuthorAgeFilesLines
* timeout: add support for "timeout -k KILL_SECS"Matthew Slowe2021-12-171-11/+32
| | | | | | | | | | | | | function old new delta timeout_main 307 373 +66 timeout_wait - 42 +42 .rodata 104201 104203 +2 packed_usage 34097 34096 -1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/1 up/down: 110/-1) Total: 109 bytes Signed-off-by: Matthew Slowe <foo@mafoo.org.uk> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* printf: allow 0 as a flag and allow multiple flagsRon Yorston2021-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | The '%' character in a format specification may be followed by one or more flags from the list "+- #0". BusyBox printf didn't support the '0' flag or allow multiple flags to be provided. As a result the formats '%0*d' and '%0 d' were considered to be invalid. The lack of support for '0' was pointed out by Andrew Snyder on the musl mailing list: https://www.openwall.com/lists/musl/2021/12/14/2 function old new delta printf_main 860 891 +31 .rodata 99281 99282 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 32/0) Total: 32 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uudecode: special-case "/dev/stdout", closes 14241Denys Vlasenko2021-12-121-1/+10
| | | | | | | function old new delta uudecode_main 295 322 +27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* config system: move some options closer to relevalnt tool subdirectoriesDenys Vlasenko2021-10-122-4/+35
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Make const ptr assign as function call in clangYU Jincheng2021-10-091-1/+1
| | | | | | | | - This can act as memory barrier in clang to avoid read before assign of a const ptr Signed-off-by: LoveSy <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mktemp: add --tmpdir optionAndrej Valek2021-10-081-1/+15
| | | | | | | | | | | | | | | | | | Make mktemp more compatible with coreutils. - add "--tmpdir" option - add long variants for "d,q,u" options Note: Upstream ca-certificate update script started using this option. function old new delta .rodata 104179 104219 +40 mktemp_main 186 194 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 48/0) Total: 48 bytes Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: generalize "const trick"YU Jincheng2021-10-071-3/+2
| | | | | | | | While at it, change all "__asm__" to "asm" Co-authored-by: canyie <31466456+canyie@users.noreply.github.com> Signed-off-by: YU Jincheng <shana@zju.edu.cn> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: clarify what bb_mode_string() generatesDenys Vlasenko2021-09-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: eliminate a static data array in bb_mode_string()Denys Vlasenko2021-09-173-4/+8
| | | | | | | | | | | | | | | | function old new delta print_stat 861 869 +8 header_verbose_list_ar 73 77 +4 display_single 975 979 +4 header_verbose_list 237 239 +2 bb_mode_string 124 115 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 18/-9) Total: 9 bytes text data bss dec hex filename 1043136 559 5052 1048747 1000ab busybox_old 1043153 559 5020 1048732 10009c busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* chmod: correctly report changed modesDenys Vlasenko2021-09-171-1/+2
| | | | | | | | | | | Chmod used to incorrectly report as changed even files for which the mode did not change. This was caused by extra bits in the st_mode, that were not present when parsed from passed argument in the form of octal number. Patch by Wolf <wolf@wolfsden.cz>. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* date,touch: allow timezone offsets in datesRon Yorston2021-09-172-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | Allow ISO 8601 style dates to include a timezone offset. Like the '@' format these dates aren't relative to the user's current timezone and shouldn't be subject to DST adjustment. - The implementation uses the strptime() '%z' format specifier. This an extension which may not be available so the use of timezones is a configuration option. - The 'touch' applet has been updated to respect whether DST adjustment is required, matching 'date'. function old new delta parse_datestr 624 730 +106 static.fmt_str 106 136 +30 touch_main 388 392 +4 date_main 818 819 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 141/0) Total: 141 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* df: "support" -H as an alias of -hDenys Vlasenko2021-09-111-11/+15
| | | | | | | | | | function old new delta df_main 1065 1068 +3 .rodata 104232 104233 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 4/0) Total: 4 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* basename: implement -a and -s SUFFIXDenys Vlasenko2021-09-091-24/+38
| | | | | | | | | | | function old new delta basename_main 145 207 +62 packed_usage 33914 33950 +36 .rodata 104241 104250 +9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 107/0) Total: 107 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: add a TODO, code shrinkDenys Vlasenko2021-09-071-10/+14
| | | | | | | function old new delta shuf_main 501 500 -1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: make -i 99999999990-100000000000 work even on 32 bitsDenys Vlasenko2021-09-041-26/+19
| | | | | | | | | | function old new delta shuf_main 443 501 +58 .rodata 104238 104245 +7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 65/0) Total: 65 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: in -i RANGE, accept numbers up to width of pointersDenys Vlasenko2021-08-291-10/+28
| | | | | | | | function old new delta .rodata 108468 108474 +6 shuf_main 555 542 -13 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: with -i LOW-HIGH, do not allow any argv'sDenys Vlasenko2021-08-231-0/+3
| | | | | | | function old new delta shuf_main 436 441 +5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: tweak --help textDenys Vlasenko2021-08-231-4/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: speed-up when limited output is requestedRon Yorston2021-08-221-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A user noted that the following command was slower than they expected: busybox shuf -i "1500000000-$(date +%s)" -n 5 At time of writing the range contains 128 million values. On my system this takes 7.7s whereas 'shuf' from coreutils takes a handful of milliseconds. Optimise BusyBox 'shuf' for cases where -n is specified by stopping shuffling once the required number of lines have been processed. On my system the time for the example is reduced to 0.4s. function old new delta shuf_main 520 540 +20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 20/0) Total: 20 bytes v2: Code shrink. Since outlines <= numlines: - the loop in shuffle_lines() only needs to test the value of outlines; - shuffle_lines() can be called unconditionally. Update timing to allow for the 13 million seconds elapsed since v1. Signed-off-by: Ron Yorston <rmy@pobox.com> 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>
* touch: fix SEGV if !ENABLE_FEATURE_TOUCH_SUSV3Denys Vlasenko2021-08-151-0/+2
| | | | 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>
* cut: add toybox-compatible options -O OUTSEP, -D, -F LISTRob Landley2021-07-201-97/+110
| | | | | | | | | | | | function old new delta cut_main 884 1201 +317 packed_usage 33823 33885 +62 .rodata 104186 104179 -7 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 379/-7) Total: 372 bytes Signed-off-by: Rob Landley <rob@landley.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: revert last change (short name must be allocated)Denys Vlasenko2021-06-251-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cp,mv: fix -t DIR optionRon Yorston2021-06-252-4/+4
| | | | | | | | | | | | | | When the '-t DIR' option is used the loop over the remaining arguments should terminate when a NULL pointer is reached. function old new delta mv_main 585 590 +5 cp_main 492 496 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 9/0) Total: 9 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uniq: really support -zRon Yorston2021-06-241-1/+1
| | | | | | | | Commit 894466cc5 (uniq: support -z) added support for NUL delimited output. Unfortunately nobody told getopt32(). Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nproc: code shrinkDenys Vlasenko2021-06-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: code shrinkDenys Vlasenko2021-06-241-1/+1
| | | | | | | function old new delta scan_and_display_dirs_recur 576 574 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cp: implement -nDenys Vlasenko2021-06-221-8/+11
| | | | | | | | | | | | function old new delta .rodata 103681 103722 +41 packed_usage 33698 33717 +19 copy_file 1678 1696 +18 cp_main 500 492 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/1 up/down: 78/-8) Total: 70 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* crc32: code shrink for !CKSUM configDenys Vlasenko2021-06-221-11/+17
| | | | | | | function old new delta cksum_main 215 203 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cksum: fix handling of read errorsDenys Vlasenko2021-06-221-3/+7
| | | | | | | function old new delta cksum_main 377 399 +22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* crc32: new appletDenys Vlasenko2021-06-221-15/+27
| | | | | | | | | | | | | function old new delta cksum_main 258 377 +119 .rodata 103672 103681 +9 applet_names 2745 2751 +6 applet_main 1588 1592 +4 packed_usage 33734 33698 -36 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/1 up/down: 138/-36) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cp: implement -t DIRDenys Vlasenko2021-06-211-59/+71
| | | | | | | | | | | function old new delta packed_usage 33713 33734 +21 .rodata 103670 103672 +2 cp_main 506 500 -6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 23/-6) Total: 17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* cp: preparatory indenting of code block, no code changesDenys Vlasenko2021-06-211-31/+31
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* df: support -t TYPEDenys Vlasenko2021-06-201-12/+19
| | | | | | | | | | | function old new delta packed_usage 33656 33716 +60 df_main 1029 1065 +36 .rodata 103395 103397 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 98/0) Total: 98 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* df: POSIXLY_CORRECT sets _default_ scale, -m/-h overrides itDenys Vlasenko2021-06-201-7/+7
| | | | | | | function old new delta df_main 1034 1029 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shred: with -u, unlink file even if it is zero lengthDenys Vlasenko2021-06-201-5/+5
| | | | | | | function old new delta shred_main 391 387 -4 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shred: implement -s SIZEDenys Vlasenko2021-06-201-3/+11
| | | | | | | | | | | function old new delta shred_main 337 391 +54 .rodata 103393 103395 +2 packed_usage 33666 33656 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 56/-10) Total: 46 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* env: implement -0Denys Vlasenko2021-06-171-3/+6
| | | | | | | | | | | function old new delta packed_usage 33590 33618 +28 env_main 187 209 +22 .rodata 103242 103250 +8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 58/0) Total: 58 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* mv: implement -t and -TDenys Vlasenko2021-06-171-24/+50
| | | | | | | | | | | function old new delta mv_main 496 585 +89 .rodata 103188 103242 +54 packed_usage 33549 33590 +41 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 184/0) Total: 184 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uniq: support -zDenys Vlasenko2021-06-172-10/+14
| | | | | | | | | | function old new delta uniq_main 391 427 +36 packed_usage 33570 33549 -21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 36/-21) Total: 15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* du: support -b "apparent size"Denys Vlasenko2021-06-161-12/+21
| | | | | | | | | | | | | function old new delta du 434 470 +36 packed_usage 33542 33570 +28 print 57 78 +21 du_main 286 302 +16 .rodata 103187 103188 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 5/0 up/down: 102/0) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: simplify check that we have at least one FILEDenys Vlasenko2021-06-151-5/+2
| | | | | | | | | | | function old new delta .rodata 103190 103194 +4 packed_usage 33541 33537 -4 shred_main 354 337 -17 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/2 up/down: 4/-21) Total: -17 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more --help tweaksDenys Vlasenko2021-06-151-1/+1
| | | | | | | function old new delta packed_usage 33552 33541 -11 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: --help tweaksDenys Vlasenko2021-06-146-12/+22
| | | | | | | function old new delta packed_usage 33589 33552 -37 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* base32/64: accept -i "skip bad chars" option (currently in effect ↵Denys Vlasenko2021-06-131-2/+4
| | | | | | | | | unconditionally) function old new delta .rodata 103189 103190 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more --help tweakingDenys Vlasenko2021-06-131-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: more --help tweaks, mostly expanding ts --helpDenys Vlasenko2021-06-134-5/+5
| | | | | | | function old new delta packed_usage 33554 33596 +42 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: --help tweaksDenys Vlasenko2021-06-133-9/+11
| | | | | | | | | | function old new delta .rodata 103190 103189 -1 packed_usage 33590 33566 -24 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-25) Total: -25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: trim --help textDenys Vlasenko2021-06-051-9/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>