Commit Graph

18467 Commits

Author SHA1 Message Date
Vincent JARDIN 764eef59cd tests/truncate: add regression tests for -s %SIZE round-up bug (#10901)
The old RoundUp formula `fsize + fsize % size` was incorrect. For
example, `truncate -s %128K` on a 24696-byte file produced 49392
bytes instead of the correct 131072 bytes.

This was incidentally fixed in commit fe9793331 ("truncate: eliminate
duplicate stat() syscall") by replacing the formula with
`fsize.checked_next_multiple_of(size)`. However, the existing test
`test_round_up` used values (fsize=10, size=4) where both the buggy
and correct formulas give the same result (12), so the bug was never
caught by the test suite.

Add unit and integration tests that would have caught this bug:
- File smaller than rounding unit (the reported scenario)
- File larger than rounding unit but not aligned
- File already aligned to the rounding unit
- Division by zero (RoundUp with size=0)

Link: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/48210

Signed-off-by: Vincent Jardin <vjardin@free.fr>
2026-02-14 06:02:24 -08:00
Sylvestre Ledru 03127aa0eb csplit: add benchmarks for line number and regex pattern splitting (#10927) 2026-02-14 14:05:48 +01:00
Sylvestre Ledru 54566dd9da sort: fix panic when collator not available in worker threads (#10915) 2026-02-14 06:33:22 -05:00
mattsu eea061db56 ls:fix ls dired reports (#10527)
* refactor: simplify DisplayItemName struct and improve dired position handling

This commit refactors the `display_item_name` function to return a `DisplayItemName` struct containing both the displayed name and its dired length, rather than just the OsString. This change simplifies the code by:

1. Eliminating the need to call `dired_name_len()` separately after getting the displayed name
2. Reducing redundant length calculations in the dired position handling
3. Making the code more maintainable by encapsulating related data together

The change also fixes an issue where dired positions were being calculated incorrectly for symlink names that required quoting, ensuring proper highlighting in dired mode.

Closes: #10248
2026-02-14 10:50:11 +01:00
cerdelen e4b3b5ca72 date: Fix format optional argument to capture all following parameters (#10914) 2026-02-13 16:13:01 -05:00
WhateverAWS 93ae9346a9 hostname: fix panic on hostname > /dev/full (#10912) 2026-02-13 07:47:58 -08:00
oech3 d2f5cfded9 echo --version >/dev/full panics (#10853) 2026-02-13 07:36:24 -08:00
Christopher Dryden dec633c0bd fix: cargo fmt and restrict /dev/full tests to Linux 2026-02-12 20:48:05 +01:00
Christopher Dryden d15e762a90 date,comm,tty: add integration tests for write error handling 2026-02-12 20:48:05 +01:00
Christopher Dryden 01605c3955 date,comm,tty: fix write error detection for io-errors GNU test 2026-02-12 20:48:05 +01:00
Chris Dryden 57043cbb63 ls: release directory fds before recursing to avoid EMFILE - 12x mem improv (#10894) 2026-02-12 20:46:47 +01:00
✿ Fleur de Blue caf7c44a9c ptx: fix panic when truncation string/keyword contain multibyte Unicode (#10836)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 16:34:22 +01:00
Chris Dryden 7154766380 Replace 'rm1' with 'symlink' in ignore list (#10804)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 16:10:04 +01:00
oech3 8e5966300b cat: strip errno (#10885) 2026-02-12 03:27:17 -08:00
Sylvestre Ledru 8d8e7f8879 stat: fix mount table read when /proc is unavailable (#10300)
Only read mount information when needed (%m directive) and handle
gracefully when /proc/self/mountinfo is not accessible, fixing
stat failures in chroot environments without /proc mounted.

see https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2133797

Co-authored-by: Chris Dryden <christopher.paul.dryden@gmail.com>
2026-02-12 02:55:13 -08:00
cerdelen 04e258f171 chroot: fix gid being set by uid with --userspec #10307 (#10465)
* chroot: fix gid being set by uid with --userspec

* chroot: check using sync user that has uid != gid

* chroot: correct Error response on failure case

* chroot: fix test

* chroot: test failure output

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 02:54:14 -08:00
Kaua Klassmann 808865e4ac fix: scientific notation is incorrectly parsed in general numeric sort (#10437)
* fix: scientific notation is incorrectly parsed in general sort

* test(sort): refactor exponents_positive_general test

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 02:52:22 -08:00
hlsxx 07567b1c63 fix: uptime > /dev/full panic fix (#10827)
* fix: uptime > /dev/full panic fix

* style: fmt

* fix: writeln -> write

* uptime: prints replacement

* uptime(test): remove pipe_in from test

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 02:51:47 -08:00
lyra 1c023bfad9 readlink: Set silent mode as default (#10711)
* readlink: Set silent mode as default

* readlink: Add tests for verbose and silent options

* readlink: Change test to work with Windows-specific error message

* readlink: Add additional test cases

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 02:51:28 -08:00
renovate[bot] 74b13c0fd0 chore(deps): update rust crate tempfile to v3.25.0 2026-02-12 10:59:14 +01:00
Chris Dryden f2a9f4bf25 ptx: implement -t/--typeset-mode to change default width to 100 (#10856)
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-02-12 10:33:19 +01:00
xtqqczze 49e35bd13a Revert "chore(deps): update rust crate libc to v0.2.181"
This reverts commit c5ca269d87.
2026-02-12 09:33:13 +01:00
Daniel Hofstetter 30f502a016 date: fix trivially_copy_pass_by_ref lint 2026-02-12 08:29:03 +01:00
Daniel Hofstetter d486483d02 Bump jiff from 0.2.19 to 0.2.20 2026-02-12 08:29:03 +01:00
oech3 38c9af31d2 stty: cleanup cfg 2026-02-12 08:10:23 +01:00