aboutsummaryrefslogtreecommitdiff
path: root/coreutils (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* cat: allow compiling out -n and -bKang-Che Sung2017-07-141-21/+38
| | | | | | | | | | When these options were introduced in d88f94a5df3a2edb8ba56fab5c13674b452f87ab it provides no config options to compile them out. Now provide one. Introduce config FEATURE_CATN. Signed-off-by: Kang-Che Sung <explorer09@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shuf: fix random line selection. Closes 9971Denys Vlasenko2017-07-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | """ For example, given input file: foo bar baz after shuffling the input file, foo will never end up back on the first line. This came to light when I ran into a use-case where someone was selecting a random line from a file using shuf | head -n 1, and the results on busybox were showing a statistical anomaly (as in, the first line would never ever be picked) vs the same process running on environments that had gnu coreutils installed. On line https://git.busybox.net/busybox/tree/coreutils/shuf.c#n56 it uses r %= i, which will result in 0 <= r < i, while the algorithm specifies 0 <= r <= i. """ Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: new function bb_getgroups() - allocating wrapper around getgroups()Denys Vlasenko2017-07-041-26/+7
| | | | | | | | | | function old new delta bb_getgroups - 111 +111 nexpr 843 757 -86 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 111/-86) Total: 25 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: fix support for long options when FEATURE_LS_COLOR is deselectedLaurent Bercot2017-05-261-6/+8
| | | | | | | | | | | Declaration of ls_longopts and initialization of applet_long_options were incorrectly guarded with ENABLE_FEATURE_LS_COLOR; that yielded a "ls: NO_OPT: \xff" error message when long options were selected and color support was not. This patch ensures long options are initialized separately from color support. Signed-off-by: Laurent Bercot <ska-dietlibc@skarnet.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko2017-04-171-1/+1
| | | | | | By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: fix stray semicolonDenys Vlasenko2017-04-171-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: support "no-argvs" usageDenys Vlasenko2017-04-141-17/+39
| | | | | | | | | | | function old new delta factorize_numstr - 72 +72 packed_usage 31562 31566 +4 factor_main 109 101 -8 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/1 up/down: 76/-8) Total: 68 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: improve comments for sieving logic... also fix a typoDenys Vlasenko2017-04-131-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: improve comments for sieving logicDenys Vlasenko2017-04-131-2/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: tweak commentsDenys Vlasenko2017-04-131-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* catv: convert this bbox-specific applet into "cat -v"Denys Vlasenko2017-04-122-114/+122
| | | | | | | | | | | | | | function old new delta cat_main 150 320 +170 packed_usage 31511 31552 +41 applet_install_loc 190 189 -1 applet_main 1516 1512 -4 applet_names 2618 2613 -5 catv_main 227 - -227 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 2/3 up/down: 211/-237) Total: -26 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* fix errors found with make_single_applets.shDenys Vlasenko2017-04-122-29/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Sort more misplaced applets into coreutils or util-linuxDenys Vlasenko2017-04-122-390/+122
| | | | | | | | No code changes Surprisingly, nice and renice are coming from different packages :) Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Sort some miscutils/ applets into coreutils or util-linuxDenys Vlasenko2017-04-121-0/+127
| | | | | | No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* w: new applet, alias to "who -H"Denys Vlasenko2017-04-111-4/+44
| | | | | | | | | | | | function old new delta who_main 451 463 +12 packed_usage 31477 31485 +8 applet_main 1508 1512 +4 applet_names 2606 2608 +2 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 4/0 up/down: 26/0) Total: 26 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: remove debug codeDenys Vlasenko2017-04-111-19/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* libbb: move isqrt from factor, use it in diff tooDenys Vlasenko2017-04-111-18/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: much faster, and very slightly larger isqrt()Denys Vlasenko2017-04-111-34/+10
| | | | | | | function old new delta isqrt_odd 70 88 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: don't be too clever in isqrt - be small insteadDenys Vlasenko2017-04-101-10/+12
| | | | | | | function old new delta isqrt_odd 111 70 -41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: add code to test isqrt() correctnessDenys Vlasenko2017-04-101-0/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: 25% faster sievingDenys Vlasenko2017-04-101-19/+48
| | | | | | | function old new delta factorize 287 260 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: better comments, slightl more clever conversion even->oddDenys Vlasenko2017-04-101-5/+26
| | | | | | | function old new delta isqrt_odd 114 111 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: fix HALF_FMT usageDenys Vlasenko2017-04-101-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: fix commentsDenys Vlasenko2017-04-101-2/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: a bit more simple isqrtDenys Vlasenko2017-04-101-1/+1
| | | | | | | function old new delta isqrt_odd 87 80 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: simpler isqrtDenys Vlasenko2017-04-101-24/+39
| | | | | | | function old new delta isqrt_odd 102 87 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: factor2 variable is unused now, drop itDenys Vlasenko2017-04-091-6/+0
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: expand commentsDenys Vlasenko2017-04-091-4/+7
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: 30% faster code (estimate max possible factor just once)Denys Vlasenko2017-04-091-24/+82
| | | | | | | | | | | function old new delta factorize - 161 +161 isqrt_odd - 102 +102 factor_main 281 110 -171 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 0/1 up/down: 263/-171) Total: 92 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nl: fix copyright messageDenys Vlasenko2017-04-091-1/+3
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* factor: new appletDenys Vlasenko2017-04-091-0/+112
| | | | | | | | | | | | | | thus far only able to factor up to ULLONG_MAX function old new delta factor_main - 378 +378 packed_usage 31427 31502 +75 applet_names 2590 2597 +7 applet_main 1500 1504 +4 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/0 up/down: 464/0) Total: 464 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nproc: new appletDenys Vlasenko2017-04-071-0/+51
| | | | | | | | | | function old new delta nproc_main - 98 +98 applet_names 2584 2590 +6 applet_main 1496 1500 +4 applet_install_loc 187 188 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shred: smaller codeDenys Vlasenko2017-04-071-8/+10
| | | | | | | function old new delta shred_main 361 356 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* shred: new appletDenys Vlasenko2017-04-072-2/+106
| | | | | | | | | | | | | function old new delta shred_main - 361 +361 packed_usage 31427 31467 +40 applet_names 2578 2584 +6 applet_main 1492 1496 +4 run_applet_and_exit 679 682 +3 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 4/0 up/down: 414/0) Total: 414 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Add help text for 'uniq -i'Jody Bruchon2017-04-051-0/+1
| | | | | Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nl: use CONFIG_NL, not CONFIG_UNIQDenys Vlasenko2017-04-051-5/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* nl: new applet; also implement cat -nb (similar functionality to nl)Denys Vlasenko2017-04-052-4/+139
| | | | | | | | | | | | | | | | | function old new delta nl_main - 201 +201 print_numbered_lines - 115 +115 cat_main 36 149 +113 static.nl_longopts - 106 +106 packed_usage 31081 31182 +101 applet_main 1488 1492 +4 applet_names 2575 2578 +3 applet_suid 93 94 +1 applet_install_loc 186 187 +1 ------------------------------------------------------------------------------ (add/remove: 4/0 grow/shrink: 6/0 up/down: 645/0) Total: 645 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* uniq: add -i option to ignore caseJody Bruchon2017-03-301-2/+8
| | | | | Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* whitespace fixDenys Vlasenko2017-03-241-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* paste: delimiter list use should restart for each new output lineDenys Vlasenko2017-03-231-2/+4
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* typo fixDenys Vlasenko2017-03-231-1/+1
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* paste: new appletMaxime Coste2017-03-231-0/+138
| | | | | | | | | | | | | function old new delta paste_main - 493 +493 packed_usage 31019 31070 +51 applet_names 2569 2575 +6 applet_main 1484 1488 +4 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 3/0 up/down: 554/0) Total: 554 bytes Signed-off-by: Maxime Coste <mawww@kakoune.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* dd: call fsync() only once before exiting if conv=fsync is specifiedRostislav Skudnov2017-03-161-4/+4
| | | | | Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* *: add comment about APPLET_ODDNAME formatDenys Vlasenko2017-01-292-0/+2
| | | | | | It confused me more than once Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* link: new appletDenys Vlasenko2017-01-261-0/+41
| | | | | | | | | | | | | | | | | | | coreutils grew itself a tiny simplistic alternative to ln: Usage: link FILE LINK Create hard LINK to FILE function old new delta link_main - 75 +75 packed_usage 31114 31131 +17 applet_names 2564 2569 +5 applet_main 1480 1484 +4 applet_install_loc 185 186 +1 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 102/0) Total: 102 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ftpd/ls: show directories firstDenys Vlasenko2017-01-251-1/+6
| | | | | | | | | | Old TODO finally done function old new delta ls_main 548 568 +20 packed_usage 31116 31097 -19 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* tls: add 2nd cipher_id, TLS_RSA_WITH_AES_128_CBC_SHA, so far it doesn't workDenys Vlasenko2017-01-241-1/+1
| | | | | | | | | | Good news that TLS_RSA_WITH_AES_256_CBC_SHA256 still works with new code ;) This change adds inevitable extension to have different sized hashes and AES key sizes. In libbb, md5_end() and shaX_end() are extended to return result size instead of void - this helps *a lot* in tls (the cost is ~5 bytes per _end() function). Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: convert DISP_DIRNAME to a bool variableDenys Vlasenko2017-01-231-9/+3
| | | | | | | function old new delta ls_main 553 548 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: get rid of opt_flags[], handle -l1c through option_mask32Denys Vlasenko2017-01-231-67/+33
| | | | | | | | | | | | function old new delta display_single 885 888 +3 scan_and_display_dirs_recur 496 486 -10 opt_flags 11 - -11 ls_main 618 553 -65 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/2 up/down: 3/-86) Total: -83 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* ls: handle -x through option_mask32, remove default -C from --helpDenys Vlasenko2017-01-231-8/+7
| | | | | | | function old new delta packed_usage 31024 31002 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>