Teemu Pätsi
7789ef46a4
expr: handle \{ literally at the start of an expression
...
Normally, `\{` begins a range quantifier like `{n,m}`, but at the start of
an expression, there is no preceding item to apply the quantifier to.
2025-05-27 03:56:02 +03:00
Teemu Pätsi
837bab24c1
expr: Add tests for is_valid_range_quantifier function
2025-05-26 17:03:55 +03:00
Teemu Pätsi
4ee93ed6d8
expr: Remove redundant escaping of '*' character
2025-05-26 16:51:44 +03:00
Teemu Pätsi
aae62072d8
expr: Fix parsing range quantifiers in regex
2025-05-26 15:59:35 +03:00
Sylvestre Ledru
be77e142aa
Merge pull request #7991 from RenjiSann/sort-multiple-outputs
...
sort: prevent -o/--output to be specified multiple times
2025-05-26 08:10:49 +02:00
Dorian Peron
3b4226c48c
sort: prevent -o/--output to be specified multiple times
2025-05-25 23:43:48 +02:00
Sylvestre Ledru
c992ce5507
Merge pull request #7948 from BenWiederhake/dev-shred-random-source
...
shred: implement and test feature --random-source
2025-05-25 22:58:18 +02:00
Daniel Hofstetter
3f9514d115
Merge pull request #7974 from frendsick/fix/expr-regex-special-cases
...
expr: Handle more special cases for regex pattern
2025-05-25 13:39:44 +02:00
Sylvestre Ledru
7d2644f3a8
move from version 0.0.30 => 0.1.0
2025-05-24 22:28:54 +02:00
Teemu Pätsi
ab5cf74185
expr: Simplify parsing special cases for $ in regex
2025-05-24 21:18:27 +03:00
Teemu Pätsi
2a862bc385
expr: Simplify checking of the end of an expression
...
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-05-24 21:15:53 +03:00
Teemu Pätsi
b0390fe36e
expr: Handle $ at the beginning of the regex pattern
2025-05-24 01:47:35 +03:00
Teemu Pätsi
4555e6fe48
expr: Handle trailing backslash error
2025-05-24 01:47:30 +03:00
Sylvestre Ledru
5a7c50d64e
uucore: add functions to manage translations
2025-05-23 23:37:59 +02:00
Dorian Péron
cd9ce77098
Merge pull request #7953 from frendsick/fix/expr-regex-anchors
...
expr: Fix parsing regex anchors '^' and '$'
2025-05-23 15:16:28 +02:00
Teemu Pätsi
29332865a9
expr: Handle special cases for $ in regex
...
Enable fixed test `test_bre11`
2025-05-23 15:29:55 +03:00
Teemu Pätsi
f664578a4b
expr: Handle special cases for ^ in regex
2025-05-23 15:23:21 +03:00
Daniel Hofstetter
73e447224c
Adapt to API changes in nix
2025-05-23 09:24:46 +02:00
Daniel Hofstetter
3a05fa92d6
Merge pull request #7908 from sylvestre/selinux-installa
...
selinux: start the support of install
2025-05-22 15:14:08 +02:00
Alexander Shirokov
14a8f3f3f9
shred:add checks for block sizes
...
This commit adds checks for block size constants. Misconfigured sizes
could lead to overflows or performance issues. While such cases are
expected to be rare or unlikely, it's better to be notified of them
early.
2025-05-21 15:54:12 +02:00
Alexander Shirokov
24d88d777a
shred:bitwise method to set OPTIMAL_IO_BLOCK_SIZE
...
The value of the variable remains unchanged (4096 = 2 ^ 12), but using a
bitwise expression provides two benefits:
- follows the same approach used for configuring BLOCK_SIZE
- indicates that a power-of-two value is preferred for this kind of
constant
2025-05-21 14:54:58 +02:00
Tom D.
9fce1a1529
tsort: remove duplicate sorting step ( #7965 )
...
* tsort: remove duplicate sorting step
* tsort: remove unnecessary spaces
---------
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-05-21 10:29:21 +02:00
Sylvestre Ledru
38861cc767
selinux: add support for install
2025-05-21 09:51:27 +02:00
Sylvestre Ledru
71af6d2089
selinux/uucore: add two functions: contexts_differ & preserve_security_context
2025-05-21 09:51:27 +02:00
Sylvestre Ledru
a7b005c5e3
Merge pull request #7942 from cakebaker/sync_move_function_call_to_unsafe_block
...
sync: move call to unsafe fn to unsafe block
2025-05-20 09:44:48 +02:00
Daniel Hofstetter
dde7324e3f
mv: use bool instead of Result as return type
...
for can_delete_file function
2025-05-20 07:31:57 +02:00
Daniel Hofstetter
cdca6d6a8d
sync: move call to unsafe fn to unsafe block
2025-05-19 11:18:12 +02:00
Ben Wiederhake
5a8fad8443
shred: implement and test feature --random-source
2025-05-19 11:17:55 +02:00
Daniel Hofstetter
ee665fbebe
more: fix warning from let_and_return lint
2025-05-19 10:08:40 +02:00
Daniel Hofstetter
8674e86703
cp: fix warnings from unnecessary_debug_formatting
...
Co-authored-by: Jeremy Smart <jeremy3141592@gmail.com>
2025-05-19 09:54:37 +02:00
Daniel Hofstetter
7a706b5756
mv: fix warning from io_other_error lint
...
Co-authored-by: Jeremy Smart <jeremy3141592@gmail.com>
2025-05-19 09:27:36 +02:00
Aaron Ang
7692b93ea6
more: constant mem initialization for files and pipes
2025-05-18 21:09:48 +02:00
Daniel Hofstetter
438ed3c6c6
doc: fix warnings from markdown linter
2025-05-18 21:08:27 +02:00
Jeremy Smart
a5a9f7d44d
pr: migrate from quick-error to thiserror ( #7919 )
...
* remove quick-error from pr
* fix windows compilation, Cargo.toml
2025-05-15 09:19:46 +02:00
Sylvestre Ledru
5e11842428
Merge pull request #7932 from cakebaker/ls_remove_duplicate_code
...
ls: remove duplicate code
2025-05-15 09:19:16 +02:00
Nicolas Boichat
1fc14d837c
wc: Align buffer to 32-byte boundary
...
bytecount uses vector operations to speed up line counting.
At least on x86 with AVX2 support, the vectors are 256-byte wide,
and operations are much faster if the data is aligned.
Saves about 4% of total performance, matching wc's performance.
2025-05-15 05:03:08 +02:00
Nicolas Boichat
1fe539f1d4
wc: Increase buffer size to 256kb
...
Improves performance by about 4% on large files.
2025-05-15 05:02:27 +02:00
Daniel Hofstetter
c3fea933e1
ls: remove duplicate code
2025-05-14 17:00:00 +02:00
Daniel Hofstetter
a6d9bfbaa0
mktemp: use keep instead of deprecated into_path
2025-05-12 07:43:26 +02:00
Alexander Shirokov
a73c0ea290
shred: improve write logic to support data alignment
...
This commit improves the reliability of the writing logic and removes
implicit dependencies between the preferred I/O size and the block size.
For example, in earlier versions, using BLOCK_SIZE != N * IO_SIZE could
lead to overflows due to alignment with values larger than the buffer
size.
2025-05-11 23:36:53 +02:00
Alexander Shirokov
745d2add08
shred: add 4K data alignment
...
This commit allows aligning output data by 4K to better match GNU shred.
The 4K block size is configured as a constant because it provides a
widely used value in the simplest way. However, there is a chance that
some systems may use a different value. So far, I haven't encountered
anything other than 4K, I decided not to overcomplicate the approach for
now.
2025-05-11 23:36:53 +02:00
Daniel Hofstetter
f4b1a97c0a
id: remove unnecessary to_string calls
2025-05-11 13:35:43 +02:00
Sylvestre Ledru
545fab9544
selinux: add the desc of the module
2025-05-11 09:36:18 +02:00
Sylvestre Ledru
6091d0b62b
selinux: use the uucore::selinux::is_selinux_enabled() function
2025-05-11 09:36:15 +02:00
Sylvestre Ledru
45b0c39ed7
Merge pull request #7892 from cakebaker/uptime_refactor_uumain
...
uptime: refactor `uumain`
2025-05-09 22:11:44 +02:00
Daniel Hofstetter
7c865b29a1
Merge pull request #7898 from sylvestre/selinux-err
...
selinux: get closer to the GNU error msgs
2025-05-09 13:35:29 +02:00
Jeremy Smart
a752f73476
csplit: don't add a newline if the file doesn't end with one ( #7901 )
...
* csplit: don't add a newline if the file doesn't end with one
* refactor test
* refactor
2025-05-09 09:15:54 +02:00
Sylvestre Ledru
fde3733bf5
selinux: improve the error display
2025-05-07 22:58:52 +02:00
Sylvestre Ledru
832dd495bf
selinux: adjust more error messages
2025-05-07 22:58:46 +02:00
Sylvestre Ledru
2e34d94e17
selinux: upstream expects lower case
2025-05-07 22:58:39 +02:00