summaryrefslogtreecommitdiff
path: root/coreutils
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* ls: don't output any colors with TERM=dumbSören Tempel2021-06-041-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | The TERM variable is usually set to "dumb" to indicate that the terminal does not support any ANSI escape sequences. Presently, ls does not honor this variable and outputs colors anyhow which results in unreadable output, unless the user explicitly disables colors using `ls --color=never`. The rational behind this change is that ls should "just work" by default, even on dumb terminals. For this reason, this patch adds a check which additionally consults the TERM variable before printing any colors. This is analogous to the existing check for ensuring that standard output is a tty. As such, colors can still be forced with `--color=force`, even if TERM is set to dumb. function old new delta is_TERM_dumb - 40 +40 ls_main 579 598 +19 .rodata 103246 103251 +5 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 64/0) Total: 64 bytes Signed-off-by: Sören Tempel <soeren+git@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tail: do not lose the tail of old file if new file (-F) is detectedDenys Vlasenko2021-06-021-12/+26
| | | | | | | | | | function old new delta tail_main 1619 1645 +26 .rodata 103246 103250 +4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 30/0) Total: 30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tail: fix typo in variable nameDenys Vlasenko2021-06-021-6/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* head,tail: trim --help textDenys Vlasenko2021-06-022-14/+16
| | | | | | | function old new delta packed_usage 33598 33560 -38 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* echo: fix !ENABLE_FEATURE_FANCY_ECHO buildDenys Vlasenko2021-04-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: --help text tweaksDenys Vlasenko2021-04-1413-17/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: shorten --help textDenys Vlasenko2021-04-141-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: code shrinkDenys Vlasenko2021-04-141-6/+4
| | | | | | | function old new delta touch_main 424 421 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: fix -amDenys Vlasenko2021-04-141-5/+8
| | | | | | | function old new delta touch_main 414 424 +10 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dd: support iflag=count_bytesRafał Miłecki2021-04-131-18/+32
| | | | | | | | | | | | | | It allows passing amount of bytes in the count= function old new delta packed_usage 33599 33617 +18 static.iflag_words 29 41 +12 dd_main 1601 1607 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 36/0) Total: 36 bytes Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: fix previous commitDenys Vlasenko2021-04-131-1/+1
| | | | | | | function old new delta touch_main 423 414 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: make FEATURE_TOUCH_NODEREF unconditionalDenys Vlasenko2021-04-131-18/+9
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: code shrinkDenys Vlasenko2021-04-131-4/+4
| | | | | | | function old new delta touch_main 450 423 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: code shrinkDenys Vlasenko2021-04-131-23/+17
| | | | | | | | | | function old new delta .rodata 103215 103218 +3 touch_main 460 450 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 3/-10) Total: -7 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: prevent usage of -r and -t at onceXabier Oneca2021-04-131-7/+11
| | | | | | | coreutils forbids this combination. Signed-off-by: Xabier Oneca <xoneca@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: switch to using utimensat() and futimens()Denys Vlasenko2021-04-131-41/+16
| | | | | | | | | | | | | | | | | | | | | | This patch changes the functions used to update timestamps in touch. Before, utimes() and lutimes() were used, which had certain disadvantages. They are unable to handle nanosecond timestamps, and implementations of certain features like -a and -m require running stat() in a loop. Almost all implementations of utimes() and lutimes() are wrappers for utimensat(), this is the case for glibc, ulibc and musl libc. function old new delta __futimens_time64 - 24 +24 __lutimes_time64 80 - -80 touch_main 539 456 -83 ------------------------------------------------------------------------------ (add/remove: 2/2 grow/shrink: 0/1 up/down: 24/-163) Total: -139 bytes Signed-off-by: urmum-69 <urmum69@snopyta.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: unbreak -hDenys Vlasenko2021-04-121-9/+10
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: remove unneeded GETOPT32 definesXabier Oneca2021-04-121-18/+13
| | | | | | | | | | | | | | Long options handling (getopt32 vs getopt32long) is done in libbb.h, no need to care here of the same logic. This cleans the code a bit. Also, --no-create was grouped as a SUSv3 option, where as the short -c was not. Even if it is part of SUS, leave it out as was the short option. v2: Fix for disabled ENABLE_LONG_OPTS. getopt32long does not like IF_FEATURE_xxx() style conditionals... :/ Signed-off-by: Xabier Oneca <xoneca@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* touch: fix atime set from reference fileXabier Oneca2021-04-121-1/+2
| | | | | | | | When using a file's times as reference, use both atime and mtime for the files to be modified. Signed-off-by: Xabier Oneca <xoneca@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>