karlmcdowall
f94ff78ea4
head: fix bug reading back through files ( #7248 )
...
* head: fix bug reading back through files
Fix issue #7247 .
Rework logic for reading/seeking backwards through files.
Bug was seen when reading back through large files.
Added test case to validate fix.
2025-02-03 20:13:46 +01:00
Dorian Péron
f2cf08b4e6
test(cksum): fix and un-ignore test_md5_bits
2025-02-03 11:06:47 +01:00
Dorian Péron
2fadd253f7
cksum: fix --binary reset (issue #6375 )
2025-02-03 09:58:52 +01:00
Sylvestre Ledru
717a6921fc
Merge pull request #7246 from RenjiSann/printf-negative-asterisk
...
printf: negative asterisk param changes alignment
2025-02-02 23:13:56 +01:00
Jeffrey Finkelstein
db280b6e9f
printf: error on missing hexadecial escape value
...
Change `printf` to correctly terminate with an error message when an
escape sequence starts with `\x` but doesn't include a literal
hexadecimal value after. For example, before this commit,
printf '\x'
would output `\x`, but after this commit, it terminates with an error
message,
printf: missing hexadecimal number in escape
Fixes #7097
2025-02-02 11:07:31 -05:00
Dorian Peron
dcc2f1b72c
printf: remove unneeded Result<> from resolve_asterisk* functions
2025-01-31 16:54:01 +01:00
Dorian Peron
707e346b84
printf: negative asterisk param changes alignement
2025-01-31 16:50:26 +01:00
Daniel Hofstetter
527602248f
shuf: adapt to API changes of rand
2025-01-30 10:39:00 +01:00
Daniel Hofstetter
7cff766bdc
mktemp: adapt to API change of rand
2025-01-30 08:52:42 +01:00
Daniel Hofstetter
ddb027231f
shred: adapt to API changes of rand
2025-01-30 08:52:42 +01:00
Daniel Hofstetter
a5fb8f952b
sort: adapt to API changes of rand
2025-01-30 08:52:42 +01:00
Dorian Peron
ae6cb8fed3
printf: show warning message in case of excess arguments
2025-01-29 14:01:35 +01:00
Tommaso Fellegara
1595b6afaa
kill: use only least significant bits to identify signal with -l ( #7225 )
...
* kill: check the lower 5 bits when the input is a number
* test/kill: added testcase
* kill: check the last 7 bits
* kill: check only the last 8 bits and the signals in the range [128, 159]
---------
Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-01-28 10:21:19 +01:00
Sylvestre Ledru
7747351cb1
Merge pull request #7227 from cakebaker/bump_nom
...
Bump `nom` and adapt `tr` to API changes
2025-01-27 11:11:52 +01:00
Daniel Hofstetter
5efd51b5ce
tr: adapt to API changes in nom
2025-01-27 10:27:08 +01:00
Daniel Hofstetter
120b6aeb73
Merge pull request #7220 from sylvestre/docsrs-uucore
...
uucore/docs.rs: generate the doc for all features
2025-01-27 09:31:56 +01:00
Sylvestre Ledru
2e09fdcbdf
uucore/docs.rs: generate the doc for all features
2025-01-26 19:54:12 +01:00
Alexander Shirokov
ae7238bbdf
od:use derived PartialEq and Eq
...
Removing custom PartialEq and Eq implementations helps avoid issues like:
help: refactor your code, or use `std::ptr::fn_addr_eq` to suppress the lint
|
29 | (IntWriter(a), IntWriter(b)) => std::ptr::fn_addr_eq(*a, *b),
| ++++++++++++++++++++++ ~~~ +
Observable on nightly 1.86
2025-01-26 11:42:35 +01:00
Daniel Hofstetter
dfd5885e37
Merge pull request #7207 from sylvestre/thiserror3
...
Move other programs to thiserror
2025-01-25 14:29:03 +01:00
Sylvestre Ledru
3f38a75164
groups: remove useless comment
2025-01-24 20:11:03 +01:00
Sylvestre Ledru
e3272a38f3
groups: move to thiserror
2025-01-24 20:11:03 +01:00
Sylvestre Ledru
94b655c073
tsort: move to thiserror
2025-01-24 20:11:03 +01:00
Sylvestre Ledru
096e41086d
du: move to thiserror
2025-01-24 20:11:03 +01:00
Sylvestre Ledru
3fe1cbe71f
mktemp: move to thiserror
2025-01-24 20:11:03 +01:00
Sylvestre Ledru
e7c3a4d018
nohup: move to thiserror
2025-01-24 20:11:03 +01:00
Daniel Hofstetter
2668c98d9d
kill: don't allow lowercase signal names with '-'
2025-01-24 16:43:50 +01:00
Daniel Hofstetter
10f43ec936
Merge pull request #7129 from sylvestre/chgrp
...
chgrp: add option --from
2025-01-24 10:08:35 +01:00
Sylvestre Ledru
4f83924092
Merge branch 'main' into sort-mem-percent
2025-01-23 22:52:00 +01:00
danieleades
5d6a04ab71
Fix clippy warning manual_if_else ( #7177 )
...
and enable the rule
2025-01-23 22:49:13 +01:00
Sylvestre Ledru
704421bd6b
Merge pull request #7200 from cakebaker/timeout_add_f_and_p
...
timeout: add support for `-f` and `-p` short options
2025-01-23 22:47:45 +01:00
Sylvestre Ledru
4c3e9c893a
chgrp: split the functions into two
2025-01-23 22:38:38 +01:00
Sylvestre Ledru
d76c561516
chgrp: support the --from=:X syntax
2025-01-23 22:38:38 +01:00
Sylvestre Ledru
8e9a4b5f9a
chgrp: adjust the output with group
2025-01-23 22:38:38 +01:00
Sylvestre Ledru
c45bbe3d1c
chgrp: add option --from
2025-01-23 22:38:38 +01:00
Sylvestre Ledru
5129aba0f0
Merge pull request #7192 from RenjiSann/cksum-fix-error-handling
...
cksum: Update error and flags handling to improver GNU's match
2025-01-23 22:14:17 +01:00
Sylvestre Ledru
0ba4dad0a6
print_verbose_ownership_retained_as: siplify the function
2025-01-23 22:04:25 +01:00
Dorian Peron
5d0d1c2a9d
checksum: rework exit_code setting to make use of the return type, fix logic for --ignore-missing
2025-01-23 17:04:00 +01:00
Dorian Peron
dd17a26dd8
checksum: change verbosity system so --status, --quiet and --warn override each other
2025-01-23 17:04:00 +01:00
Dorian Peron
7fff3670b3
checksum: fix improperly formatted WARNING message
2025-01-23 17:04:00 +01:00
Dorian Peron
11a0b1b505
checksum: move line warning display to process_line loop
2025-01-23 17:03:48 +01:00
Daniel Hofstetter
df91808649
timeout: add support for -f and -p short options
2025-01-23 16:05:14 +01:00
David Rebbe
c4ffeea320
sort: options -C and -c should be mutually exclusive but aren't
2025-01-23 10:20:48 +01:00
David Rebbe
fb5172eb2a
sort: needs support for human-readable block size suffixes R and Q
2025-01-22 23:35:57 -05:00
Tommaso Fellegara
93e3d08d5f
ls, date: refactor common code for formatting a datetime ( #7194 )
...
* refactoring ls and date
* Refactored and integrated ls and date and added tests to the new feature
* Style refactoring
2025-01-22 17:39:00 +01:00
Sylvestre Ledru
f731f2cba3
Merge pull request #7188 from ic3man5/main
...
sort: errors on overflowing -k argument but shouldn't
2025-01-22 10:05:51 +01:00
Daniel Hofstetter
af2a26b57f
kill: list signal 0 with -l and -t
2025-01-22 08:20:47 +01:00
David Rebbe
2ebdc4984d
sort: set -k arg to usize::MAX on overflow
...
newline, format, and more rust idiomatic code.
refactor to remove panic!
2025-01-21 22:36:43 -05:00
Jeffrey Finkelstein
94c772c082
sort: support percent arguments to -S option
...
Add support for parsing percent arguments to the `-S` option. The given
percentage specifies a percentage of the total physical memory. For
Linux, the total physical memory is read from `/proc/meminfo`. The
feature is not yet implemented for other systems.
In order to implement the feature, the `uucore::parser::parse_size`
function was updated to recognize strings of the form `NNN%`.
Fixes #3500
2025-01-20 16:24:49 -05:00
Jeffrey Finkelstein
39847a741a
Add ParseSizeError::PhysicalMem enum variant
2025-01-20 16:24:49 -05:00
Daniel Hofstetter
6a5f2aa334
Merge pull request #7175 from sylvestre/thiserror2
...
Move some programs to thiserror
2025-01-20 16:17:25 +01:00