21392 Commits
Author SHA1 Message Date
Hekzory 04a59e2208 tr: drop the -u note from extensions.md
GNU tr now accepts -u as an undocumented option as well (coreutils
commit a40b8d1191dd), so it is no longer an extension over GNU.
2026-10-10 22:51:11 +02:00
Hekzory 546f04c1de tr: reword the -u help text
Say what -u does instead of reusing the BSD man page wording.
2026-10-10 22:51:11 +02:00
Hekzory 14a18b91a6 tr: hide -u from --help and the man page
GNU tr rejects -u, so a script that uses it does not run with GNU tr.
Keep accepting the option for scripts written for FreeBSD and macOS,
but do not advertise it, the same way GNU tr accepts AIX's -A without
listing it.
2026-10-10 22:51:11 +02:00
Hekzory 8d9ad5cbb0 tr: accept -u for unbuffered output, as on FreeBSD and macOS
FreeBSD and macOS tr take -u to guarantee that output is unbuffered,
and scripts written for them use it to pass progress output through a
pipeline as it arrives, e.g. `curl ... 2>&1 | tr -u '\r' '\n'`. uutils
tr rejected the option, so such pipelines failed outright.

On Unix every chunk is already written as soon as it is translated, so
-u has nothing left to do there. Windows still writes through the line
buffered Stdout, so flush it after every chunk when -u is given.
2026-10-10 22:51:11 +02:00
renovate[bot] 01a8fc075f chore(deps): update rust crate zip to v9.0.1 2026-10-10 12:58:04 +02:00
Eyüp Can Akman 38336e921a uucore: note why huge %f integers skip the precision 2026-10-10 08:54:53 +02:00
Eyüp Can Akman 7994c2f435 seq: test a zero %e precision above the formatter limit 2026-10-10 08:54:53 +02:00
Eyüp Can Akman f7b9caa0ca printf, seq: fix %f padding past 1000 zeros and panics on zero
bigdecimal stops padding past 1000 zeros and goes to exponent notation.
Write integer digits and the fraction padding ourselves.

Zero with a precision above 65535 still panicked in %e, %a and %#g.
Build those zeros directly, and use the uppercase prefix for %A.
2026-10-10 08:54:53 +02:00
Devel 83d47598ad more: use OS errors instead of hardcoded locales
Apply suggestions recommended by Sylvestre
2026-10-10 08:53:05 +02:00
TauYip f7e5a53e12 expand, unexpand: remove unnecessary stack buffer 2026-10-10 08:51:52 +02:00
Sichen 7df8692734 *sum: rename parse_single_space after accepting tabs
The parser now accepts either a space or a tab, so
`parse_single_space` no longer describes it. Rename it to
`parse_single_blank`.
2026-10-10 08:10:44 +02:00
Sichen 98de365ee2 *sum: accept leading blanks and a tab separator in untagged lines
GNU accepts spaces and tabs before an untagged checksum line, and
either one can separate the digest from the file name. The uutils
parsers required the digest at the start and only accepted a space
separator.

Skip leading spaces and tabs in both untagged parsers, and end the
digest at the first one. Other whitespace characters stay invalid.

This also matches GNU for an empty file name: cksum and b2sum try to
check it, while md5sum and the sha*sum tools reject the line as
improperly formatted.
2026-10-10 08:10:44 +02:00
NdekoCode 391d0257e1 tests: cp: expect the native separator in the overwrite message
The walk joins paths with a backslash on Windows.
2026-10-10 05:59:41 +02:00
NdekoCode 19977e443b cp: do not panic when the -v line for a directory cannot be written
Go through print_verbose_output like the file lines do, so that a
closed or full stdout gives "write error" instead of a panic in
println!.
2026-10-10 05:59:41 +02:00
NdekoCode fff7f0abfb cp: name both paths when a directory cannot overwrite a non-directory
"cannot overwrite non-directory with directory" named neither path. A
subdirectory whose destination already existed as a regular file was
not caught at all: cp went on into it and failed later on the first
file inside, with "cannot create regular file 'd/sub/x': Not a
directory", and stopped there. A dangling symlink as the target of
`cp -r` was followed, and its target created as a directory.

Say which destination and which directory, as GNU does. Refuse a
target that is not a directory before walking the tree, and for a
subdirectory that would land on a file or a symlink, report it, leave
the subtree alone and go on with the next entry, as GNU does.
2026-10-10 05:59:41 +02:00
Sylvestre Ledru 7bc1eb6d1d ls: refactor display_items and consolidate padding functions 2026-10-09 23:18:27 +02:00
Sylvestre Ledru 76fe43faaf sort: add a test for merging in a UTF-8 locale 2026-10-09 23:16:50 +02:00
Sylvestre Ledru 16d63a5a4f sort: keep the non-locale merge comparator inlined
Moving the lazy collator comparison into merge_compare made the merge
heap comparator too large to be inlined into BinaryHeap's sift-down,
which cost ~12% more instructions for 'sort -m' in the C locale
(flagged by CodSpeed on merge_pre_sorted_files). Move the collator
path into its own out-of-line function and mark the heap comparators
#[inline].
2026-10-09 23:16:50 +02:00
Sylvestre Ledru 4485041527 sort: fix rustdoc private-intra-doc-link warning on merge_compare
The doc comment linked to the private compare_by function via
intra-doc link syntax, which rustdoc rejects with -Dwarnings since
public docs can't resolve links to private items.
2026-10-09 23:16:50 +02:00
Sylvestre Ledru 6162b8a4ba sort: merge lazily in UTF-8 locales instead of precomputing sort keys
In a UTF-8 locale `sort` precomputes a full ICU collation sort key for
every line while parsing chunks. The regular sort path needs this to
amortize O(n log n) comparisons, but merging only performs O(n log k)
comparisons (and none at all when merging a single already-sorted file),
so the keys are pure overhead there.

Add merge_compare(), which mirrors compare_by() but compares whole-line
locale keys lazily with the collator. The merge reader now runs with
fast_locale_collation disabled so Line::create no longer computes
per-line sort keys, and the merge comparator and dedup use merge_compare.

`sort -m /usr/share/dict/words` in a UTF-8 locale goes from ~70ms to
~9ms (10.5x -> 1.32x vs GNU sort), with byte-identical output. Other
sort modes and the C locale are unaffected.
2026-10-09 23:16:50 +02:00
Sylvestre Ledru 3f9a7f5a96 date: use C locale and exact output in timezone position test 2026-10-09 23:15:12 +02:00
Sylvestre Ledru 24d972e81f date: add test for locale default format timezone position
Covers date-locale-hour.sh
2026-10-09 23:15:12 +02:00
Jake Abendroth 9e7735434d date: double % in the AM/PM marker with replace 2026-10-09 22:36:47 +02:00
Jake Abendroth 7e59da7048 date: take %p and %P from the locale
Use the locale's AM_STR and PM_STR, read once, instead of jiff's AM and
PM, for %p and %P and so for the %p inside %r. A locale without markers,
like fr_FR, gets empty ones, as in GNU date.
2026-10-09 22:36:47 +02:00
Jake Abendroth b9e59cd5c8 date: take %x, %X and %r from the locale
Expand them to the locale's D_FMT, T_FMT and T_FMT_AMPM, read once,
instead of jiff's C formats. A width or flag applies to the whole
expansion, as in GNU date, and %x is expanded before an out-of-range
year is substituted into the default format.

Fixes #10284
2026-10-09 22:36:47 +02:00