1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00
Commit graph

3499 commits

Author SHA1 Message Date
Dorian Péron
c35d26dc51
Merge pull request #7693 from sargas/escape_empty_string
uucore/quoting_style: Add support for quoting/escaping empty strings
2025-04-13 23:05:28 +02:00
Sylvestre Ledru
4c796caba5
Merge pull request #7721 from Qelxiros/7166-head-maxint
head: fix overflow errors
2025-04-13 16:37:13 +02:00
Daniel Hofstetter
80b6a2155c
Merge pull request #7635 from sylvestre/temp-selinux-impl
mkdir: add the selinux support
2025-04-13 14:49:52 +02:00
Joseph Jon Booker
9f1e7a2075 printf: Add integration test for %q '' 2025-04-12 21:44:06 -05:00
Jeremy Smart
cc1112660a head: return to parse::<usize> and switch to parse_size_u64_max 2025-04-12 23:38:32 +02:00
Ben Wiederhake
a82dce0bd7 du: don't panic on block-size 0 2025-04-12 22:51:09 +02:00
Joseph Jon Booker
7df22051ea printf: Ignore thousand seperator flag 2025-04-11 23:17:50 -05:00
Joseph Jon Booker
ef7a8c300e printf: add error handling to escaped unicode characters 2025-04-11 23:17:50 -05:00
Sylvestre Ledru
81c02b7408 mkdir: add support of -Z
Should fix: gnu/tests/mkdir/selinux.sh
tests/mkdir/restorecon.sh
2025-04-10 18:26:41 -04:00
hz2
cd2b56ea9c
cp: fix update prompting (#7668)
* added logic to check if we are updating the file and the destination is newer, to skip copying

* corrected logic to handle cp update

* - added test case that mocks the issue described in #7660
- adjusted conditions to satisfy clippy

* typo

* Update src/uu/cp/src/cp.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* Update tests/by-util/test_cp.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-04-10 19:00:39 +02:00
Sylvestre Ledru
45c978fae6
Merge pull request #7686 from dan-hipschman/numfmt/add-zero-terminated-option
numfmt: add --zero-terminated option
2025-04-10 07:14:35 -04:00
Sylvestre Ledru
a89fc48388
Merge pull request #7656 from eduardorittner/main
printf: make negative values wrap around with unsigned/hex format
2025-04-10 06:48:50 -04:00
Yuri Astrakhan
d77470be2d fix clippy issues 2025-04-08 18:25:29 -04:00
Yuri Astrakhan
170831ed2b chore: remove unneeded parens
Keeps code a bit more readable
2025-04-08 18:19:03 -04:00
Sylvestre Ledru
0a99ab86e9
Merge pull request #7698 from nyurik/assert-eq
chore: use `assert_eq!` and `assert_ne!` instead of `assert!`
2025-04-08 17:00:58 -04:00
Terts Diepraam
8040305715
Merge pull request #7622 from blyxxyz/flush-bufwriters
Flush `BufWriter`s, clean up error reporting
2025-04-08 20:52:51 +02:00
Yuri Astrakhan
a27880e8a3 chore: use assert_eq! and assert_ne! instead of assert!
Makes intent clearer, and if something fails, prints the values that caused the failure as part of the panic message.
2025-04-08 13:25:41 -04:00
Dan Hipschman
81911f9f6a numfmt: add --zero-terminated option 2025-04-08 10:05:26 -07:00
Daniel Hofstetter
a77e218a79
Merge pull request #7690 from nyurik/manual-inline
chore: manual inline formatting - tests
2025-04-08 15:27:14 +02:00
Daniel Hofstetter
7f8ad6a32c
Merge pull request #7688 from nyurik/fmt-inline
chore: use inline formatting
2025-04-08 09:31:17 +02:00
Yuri Astrakhan
3dc771924c chore: cleanup trailing commas before parens
Deleted commas in cases like `foo,)` -- mostly in macros
2025-04-08 00:33:58 -04:00
Yuri Astrakhan
982805d3cd chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Yuri Astrakhan
47b10539d0 chore: use inline formatting
Minor cleanup using clippy autofix.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.

```
cargo clippy --fix --workspace -- -A clippy::all -W clippy::uninlined_format_args && cargo fmt
```
2025-04-07 22:56:21 -04:00
Clifford Ressel
b7bf8c9467
chmod: Correct chmod -R on dangling symlink and tests (#7618)
* Correct chmod -R on dangling symlink and tests

* Add tests of arg-level symlink to chmod

* Add tests of all symlink flag combos on chmod dangling

* Fix no traverse on dangling symlink

* Add chmod recursive tests of default symlink method

* Add default chmod -H flag tests

* Set chmod default traversal method correctly to -H

* Fix arg symlink chmod case

* Remove extra chmod -H testing

---------

Co-authored-by: Clifford Ressel <EMAIL@gmail.com>
2025-04-07 16:18:00 +02:00
Sylvestre Ledru
0b397c469f
Merge pull request #7401 from RenjiSann/coverage
Fix coverage files generation
2025-04-07 11:10:12 +02:00
Dorian Peron
5250b893a7 test(env): fix test_gnu_e20 for coverage run 2025-04-07 10:19:00 +02:00
eduardorittner
36ef5010e3 printf: make negative values wrap around with unsigned/hex format
To convert from negative to unsigned with overflow, we get the two's complement
representation of the absolute (unsigned) value.
2025-04-06 18:58:56 -03:00
shskwmt
58bde5453d test/cp: Fix "No such file or directory" error in test_acl_preserve
Fix a bug in test_acl_preserve that was causing "setfacl: a: No such file or directory"
error messages when running with `cargo test --features=cp test_acl_preserve`.

Changes:
- Use plus_as_string on path1 to generate the correct absolute path
- Move the file path generation closer to where it's used for better code organization
2025-04-06 23:50:14 +09:00
Joseph Jon Booker
6061b67601 printf: add tests for different octal lengths 2025-04-05 02:02:33 -05:00
Joseph Jon Booker
95e5396c4c printf: Consistently handle negative widths/precision
Also allows character constants with " instead of ', and for
interpolated values with %b to use \0XXX notation for octal bytes
2025-04-05 02:02:31 -05:00
Sylvestre Ledru
88cf66174f
Merge pull request #7648 from drinkcat/parse_time-ebd
timeout: Use common parser to parse time duration
2025-04-04 23:46:48 +02:00
Sylvestre Ledru
295628a2e9
Merge pull request #7631 from drinkcat/format-hex-default
uucore: format: Fix hexadecimal default format print
2025-04-04 23:44:35 +02:00
Nicolas Boichat
edc213d2c7 test_timeout: Add tests for very short timeouts
Note that unlike GNU coreutils, any value > 0 will not be treated
as 0, even if the exponent is very large.
2025-04-04 18:23:17 +02:00
Nicolas Boichat
e0a6482759 seq: Trim whitespaces, then try to remove +
Otherwise, `seq` crashes with ` 0xee.` as input.

Also update one of the tests to catch that.
2025-04-04 17:09:33 +02:00
Nicolas Boichat
ae3756b434 seq: Do not allow -w and -f to be specified at the same time
Fixes #7466.
2025-04-04 10:17:17 +02:00
Nicolas Boichat
84e5ee4b86 seq: Accept underflow in parameters
Also, add a test to check that a very, very, small number is
treated as 0. That's probably undefined behaviour, but it does
make some sense.
2025-04-03 17:26:38 +02:00
Nicolas Boichat
d58f1cc0f1 test_seq: Modify undefined behaviour tests
GNU `seq` doesn't support such large positive exponents anyway,
and we are limited by i64 range, so increase the exponent value
to make sure we fully overflow that range.

Also, add a test to check that a very, very, small number is
treated as 0 (that's also undefined behaviour, but it does
make sense in a way).
2025-04-03 17:26:38 +02:00
Daniel Hofstetter
5ab4968721 dd: fix "unused import" warning in test 2025-04-03 14:27:43 +02:00
Daniel Hofstetter
a8a43f73b0 clippy: fix errors from unnecessary_semicolon lint 2025-04-03 14:24:16 +02:00
Karl McDowall
a4b621ad8a cat: bugfix when running with -T option
Fixes an crash seen when running with -T option if no newline
is found in a buffer.
Added unit test to validate.
2025-04-02 18:59:27 -06:00
Nicolas Boichat
8cf4da0b19 uucore: format: Fix hexadecimal default format print
The default hex format, on x86(-64) prints 15 digits after the
decimal point, _but_ also trims trailing zeros, so it's not just
a simple default precision and a little bit of extra handling is
required.

Also add a bunch of tests.

Fixes #7364.
2025-04-01 15:04:47 +02:00
Dorian Péron
17d81bb9a1
Merge pull request #7623 from drinkcat/parse-bigdecimal-smallfixes
uucore: format: Collection of small parser fixes
2025-04-01 12:36:28 +02:00
Dorian Péron
e4fa68c57d
Merge pull request #7629 from cakebaker/uptime_fix_unused_import_warning
uptime: fix "unused import" warning in test
2025-04-01 12:09:39 +02:00
Nicolas Boichat
1e104b7ef9 uucore: format: num_parser: Add value to Overflow error
When parsing integers, we should still return the min/max value
of the type (depending on the type), and wrap that in the error.

We need to refactor the map function to handle this case better,
and add an extract function to get the value out of an error
(if any).

This fixes the integer part of #7508.
2025-04-01 11:20:17 +02:00
Dorian Péron
ace92dcca1
Merge pull request #7556 from drinkcat/parse-bigdecimal
uucore: format: num_parser: Use ExtendedBigDecimal
2025-04-01 10:52:50 +02:00
Daniel Hofstetter
1fe764230f
Merge pull request #7611 from drinkcat/stat-disable-macosx
test_stat: Disable test_stdin_pipe_fifo1/2 on Mac OS X
2025-04-01 09:42:01 +02:00
Daniel Hofstetter
7b6d05f81d uptime: fix "unused import" warning in test 2025-04-01 09:21:38 +02:00
Jan Verbeek
a9cd3f132e uniq: Flush BufWriter, make error context GNU-like 2025-03-31 13:46:33 +02:00
Jan Verbeek
181844eafa tr: Flush BufWriter, fix double error context
Write errors led with `tr: tr: write error:`.
2025-03-31 13:46:33 +02:00
Jan Verbeek
cf50952325 tail: Flush BufWriter 2025-03-31 13:46:33 +02:00