The issue is that in `chunks.rs`, `sep_iter` is relative to `search_start`.
But the returned value needs to be absolute position relative to the `buffer`.
sort -m takes: 3 lines, 96003 bytes
and emits: 4 lines, 96004 bytes
The output line lengths before the fix are:
```
a x 32000
b x 23809
b x 8191
c x 32000
```
So it splits one of the lines into two (23809 + 8191 = 32000).
In addition, the output becomes unsorted because the shorter 'b' fragment sorts before the longer 'b' fragment.
The issue is that in `chunks.rs`, `sep_iter` is relatve to `search_start`. But the returned value needs to be absolute position relative to the `buffer`.
We end up with these particular numbers because
- in merge.rs, initial chunk is created as `RecycledChunk::new(8 * 1024)` (8192 bytes)
- `search_start = 8192`; newline is at absolute buffer index `32000`
- `memchr_iter` returns `32000 - 8192 = 23808`, and newline adds + 1 byte
Use splice_unbounded_auto instead of splice_unbounded_broker to avoid
creating a broker pipe when stdout is already a pipe (e.g., when piping
to another command with |).
Fix doc comments in safe_traversal that still described the old behavior
of replacing symlinks with real directories. Rename and deduplicate tests
that were originally written as race-condition regression tests but now
just verify symlink-following behavior.
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
All comment / doc-comment changes.
- src/uucore/src/lib/features/checksum/validate.rs L471: "must set it the the detected" -> "must set it to the detected" (also adds the missing "to")
- src/uucore/src/lib/features/uptime.rs L416: "logged in in a human-readable format" -> "logged in, in a human-readable format"
- src/uu/od/src/output_info.rs L115: "the width is width of the the type" -> "the width is the width of the type"
- src/uu/split/src/filenames.rs L113: "Determine if the the output file names" -> "Determine if the output file names"
- src/uu/tail/src/paths.rs L228: "if `path` is is a file type" -> "if `path` is a file type"
- src/uu/chcon/src/chcon.rs L527: "then is is assumed to be valid" -> "then it is assumed to be valid"