aboutsummaryrefslogtreecommitdiff
path: root/coreutils
AgeCommit message (Collapse)Author
2017-07-14cat: allow compiling out -n and -bKang-Che Sung
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>
2017-07-09shuf: fix random line selection. Closes 9971Denys Vlasenko
""" 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>
2017-07-04libbb: new function bb_getgroups() - allocating wrapper around getgroups()Denys Vlasenko
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>
2017-05-26ls: fix support for long options when FEATURE_LS_COLOR is deselectedLaurent Bercot
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>
2017-04-17Spelling fixes in comments, documentation, tests and examplesDenys Vlasenko
By klemens <ka7@github.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-17factor: fix stray semicolonDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-14factor: support "no-argvs" usageDenys Vlasenko
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>
2017-04-13factor: improve comments for sieving logic... also fix a typoDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-13factor: improve comments for sieving logicDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-13factor: tweak commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-12catv: convert this bbox-specific applet into "cat -v"Denys Vlasenko
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>
2017-04-12fix errors found with make_single_applets.shDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-12Sort more misplaced applets into coreutils or util-linuxDenys Vlasenko
No code changes Surprisingly, nice and renice are coming from different packages :) Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-12Sort some miscutils/ applets into coreutils or util-linuxDenys Vlasenko
No code changes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-11w: new applet, alias to "who -H"Denys Vlasenko
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>
2017-04-11factor: remove debug codeDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-11libbb: move isqrt from factor, use it in diff tooDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-11factor: much faster, and very slightly larger isqrt()Denys Vlasenko
function old new delta isqrt_odd 70 88 +18 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: don't be too clever in isqrt - be small insteadDenys Vlasenko
function old new delta isqrt_odd 111 70 -41 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: add code to test isqrt() correctnessDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: 25% faster sievingDenys Vlasenko
function old new delta factorize 287 260 -27 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: better comments, slightl more clever conversion even->oddDenys Vlasenko
function old new delta isqrt_odd 114 111 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: fix HALF_FMT usageDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: fix commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: a bit more simple isqrtDenys Vlasenko
function old new delta isqrt_odd 87 80 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-10factor: simpler isqrtDenys Vlasenko
function old new delta isqrt_odd 102 87 -15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-09factor: factor2 variable is unused now, drop itDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-09factor: expand commentsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-09factor: 30% faster code (estimate max possible factor just once)Denys Vlasenko
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>
2017-04-09nl: fix copyright messageDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-09factor: new appletDenys Vlasenko
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>
2017-04-07nproc: new appletDenys Vlasenko
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>
2017-04-07shred: smaller codeDenys Vlasenko
function old new delta shred_main 361 356 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-07shred: new appletDenys Vlasenko
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>
2017-04-05Add help text for 'uniq -i'Jody Bruchon
Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-05nl: use CONFIG_NL, not CONFIG_UNIQDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-04-05nl: new applet; also implement cat -nb (similar functionality to nl)Denys Vlasenko
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>
2017-03-30uniq: add -i option to ignore caseJody Bruchon
Signed-off-by: Jody Bruchon <jody@jodybruchon.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-03-24whitespace fixDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-03-23paste: delimiter list use should restart for each new output lineDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-03-23typo fixDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-03-23paste: new appletMaxime Coste
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>
2017-03-16dd: call fsync() only once before exiting if conv=fsync is specifiedRostislav Skudnov
Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-29*: add comment about APPLET_ODDNAME formatDenys Vlasenko
It confused me more than once Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-26link: new appletDenys Vlasenko
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>
2017-01-25ftpd/ls: show directories firstDenys Vlasenko
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>
2017-01-24tls: add 2nd cipher_id, TLS_RSA_WITH_AES_128_CBC_SHA, so far it doesn't workDenys Vlasenko
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>
2017-01-23ls: convert DISP_DIRNAME to a bool variableDenys Vlasenko
function old new delta ls_main 553 548 -5 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2017-01-23ls: get rid of opt_flags[], handle -l1c through option_mask32Denys Vlasenko
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>
2017-01-23ls: handle -x through option_mask32, remove default -C from --helpDenys Vlasenko
function old new delta packed_usage 31024 31002 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>