Commit Graph
865 Commits
Author SHA1 Message Date
copilot-swe-agent[bot] 4ec214b40e Fix UB in IOChunk::as_str(): only cache utf8_verified on successful UTF-8 validation 2026-07-07 12:41:33 +00:00
copilot-swe-agent[bot] a18cd3fff7 Initial plan 2026-07-07 12:37:21 +00:00
renovate[bot] 30607c4ddc chore(deps): update rust crate ctor to v1.0.8 2026-07-06 08:07:50 +02:00
Diomidis Spinellis 01c8412327 Optimize multiline matching (#483)
The multiline matching resulted in a large performance regression due to
the indiscriminate use of the dotall (?s) flag.  Change the regex
selection process to use only the flag when probably needed.
2026-07-05 15:13:53 +02:00
Diomidis SpinellisandMukunda Katta f3a79c5847 Support multiline substitution flag (#482)
While at it fix . matching of embedded newlines.

This commit increases GNU passed tests by 2.

Co-authored-by: Mukunda Katta <mukunda.vjcs6@gmail.com>
2026-07-05 10:48:39 +02:00
Diomidis Spinellis a9e5fe778c Add sandbox checks (#477)
Following the introduction of the first sandbox check in b14272c1
complete the checks for the remaining commands.
2026-07-03 16:55:50 +02:00
renovate[bot] 02d0239447 chore(deps): update rust crate rand to v0.10.2 2026-07-02 16:50:42 +02:00
renovate[bot] 8b5dea703a chore(deps): update rust crate console to v0.16.4 2026-07-02 08:05:54 +02:00
renovate[bot] 34dfbc2ef1 chore(deps): update rust crate clap_complete to v4.6.7 2026-07-02 08:05:18 +02:00
Develandpre-commit-ci[bot] 8cb7090bbc --posix should reject GNU substitute flags i/I #401 (#419)
* reject 'i', 'I', 'm', 'M' and 'E' when --posix flag is set

* add test for issue 401

* formatting

* add a test for 'm' flag in test_posix_reject_flags

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update compiler.rs

* cargo fmt

* add a const variable with the err msg

* Update compiler.rs

* cargo fmt

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-01 19:30:25 +03:00
Mukunda Rao Katta 2a5ab5a9a2 feat: add z command (#428)
* feat: add z command

* test: avoid stdin race in z POSIX rejection
2026-07-01 12:51:11 +03:00
Pranav Ram Joshi b14272c1d7 Add e substitution flag
* feat: introduce e substituion for sed

When the s command is requested for sed, the e substitution flag enables execution of the result of substitution as a shell command. It matches the GNU sed behavior.

On src/sed/command.rs, add 'execute' field to 'Substitution' structure.

On src/sed/compiler.rs, handle 'e' in 'compile_subst_flags' and reject it if --posix or --sandbox flag is used in sed.

On src/sed/processor.rs, spawn /bin/sh with -c flag for a successful match and replace the pattern space with the command's standard output stream.

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* chore: comply with rustfmt

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* chore: support for Windows command-line

Instead of calling bourne shell, define a new function: shell_command() with two definitions; conditionally compiling to UNIX-like and Windows. On UNIX-like, executes the bourne shell, whereas command prompt is executed on Windows.

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* chore: check newline for Windows

Unix-like system only uses the newline character whereas Windows uses the carriage return as well as newline. Hence, when working on Windows, we need to truncate the last two characters.

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* add: 'e' flag tests

Nine new tests have been introduced in regards to new 'e' substitution option. 'test_subst_e_flag_multiline_outuput' is conditionally compiled as printf command is not guaranteed to be present on all Windows systems.

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* chore: fallback for shell_command

Executing a shell or a command prompt requires appropriate platforms. WASM does not currently support it.

Also fix a linting issue.

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* chore: linting cleanup

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

---------

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>
2026-07-01 11:18:02 +03:00
Diomidis Spinellis cd3b10db48 Document uutils Playground 2026-07-01 10:48:54 +03:00
Diomidis Spinellis 48c2f56358 Document r command extension 2026-07-01 10:42:22 +03:00
Diomidis SpinellisandPranavRJoshi dcd2df848a Implement zero-address r command to insert file before first line (#474)
* feat: support zero-address file insertion

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>

* Polish the handling of 0r

- Use common constant for error message.
- Simplify command check at compile and runtime.
- Separate runtime handling into a function.

---------

Signed-off-by: PranavRJoshi <pranavrjoshi1@gmail.com>
Co-authored-by: PranavRJoshi <pranavrjoshi1@gmail.com>
2026-07-01 08:36:03 +02:00
renovate[bot] 9efab796be chore(deps): update rust crate clap_complete to v4.6.6 2026-07-01 07:05:51 +02:00
Daniel Hofstetter b74925283f Bump anyhow from 1.0.102 to 1.0.103 (#473) 2026-06-30 11:20:26 +02:00
renovate[bot] 8baab710c3 chore(deps): update rust crate divan to v5.0.1 2026-06-27 10:53:11 +02:00
renovate[bot] 5ca2636ce3 chore(deps): update actions/cache action to v6 2026-06-24 09:09:57 +02:00
renovate[bot] 8d28215c1b chore(deps): update rust crate divan to v5 2026-06-23 15:08:10 +02:00
renovate[bot] 88d188aa03 chore(deps): update rust crate memmap2 to v0.9.11 2026-06-23 07:59:32 +02:00
renovate[bot] 5e5281be03 chore(deps): update rust crate phf_codegen to 0.14.0 2026-06-22 11:21:53 +02:00
renovate[bot] 4eda475d5c chore(deps): update rust crate phf to 0.14.0 2026-06-21 10:08:39 +02:00
renovate[bot] 9b388fca34 chore(deps): update actions/checkout action to v7 2026-06-19 08:13:11 +02:00
Sylvestre Ledru b90c599fac sed: fix brace quantifier delimiter and {,n} bound edge cases (#463) 2026-06-14 16:09:18 +02:00