Commit Graph
937 Commits
Author SHA1 Message Date
Sylvestre Ledru 3bdf96d08d sed: keep script position for errors at end of script
An error found once the script is exhausted, like an unterminated
command, was reported as ":0:N" with no input name. Keep the last input
name and line number so the error points at the right line.
2026-09-27 18:50:16 +02:00
Sylvestre Ledru 72ed709088 sed: fix panics and zero steps in ~ and , addresses
A range address that ended early made the parser panic: `1~` read past
the end of the line, and `1~p`, `1,~p` or `1,p` handed a command letter
to the address parser, which only knew how to panic on it. A missing
~step now counts as 0, and a comma with no address after it is reported
as an unexpected `,'. The address parser returns an error instead of
panicking.

A step of 0 was not handled either: `2,~0` ran to the end of the input
instead of selecting line 2 alone, and `0~0`, which can select no line,
was accepted.
2026-09-27 16:44:36 +02:00
Sylvestre Ledru 7f9ce84f34 docs: move extensions and incompatibilities to docs/src/extensions.md
Start an mdBook under docs/, laid out as in coreutils, and move the list of
extensions and incompatibilities out of the README into it. The README keeps
a pointer.

A Documentation workflow builds the book with mdbook 0.5.0, the version the
uutils website uses, whenever docs/ changes, and uploads it as an artifact.
mdbook 0.5 rejects the `multilingual` field coreutils still carries (the
website strips it before building), so the book leaves it out.
2026-09-27 11:42:09 +02:00
Sylvestre Ledru cb9135ddac prepare version 0.3.0 2026-09-27 08:14:38 +02:00
renovate[bot] 76086c8d9a Update dawidd6/action-download-artifact action to v25 2026-09-26 07:14:18 +02:00
Sichen ab2f0a82d8 in-place editing: treat each file as a separate input
sed -i with more than one file treated them as one continuous stream:
line numbers continued across files, $ matched only the last line of
the last file, and N could join lines from different files. GNU sed
documents -i as implying -s, so enable separate-file processing for
--in-place as well as --separate.

There was a second bug when automatic output was suppressed. At the end
of a file, process_file cleared a pending N action only when
!context.quiet. With -n, the action carried into the next file and
joined with its first line. Clear the action in either mode, but write
the pattern space only when automatic output is enabled.

The same bug can be reproduced without -i. With f1 containing a1, a2,
a3 and f2 containing b1, b2, b3:

sed -n -s -e 'N;s/\n/+/;p' f1 f2

Before this change it prints a1+a2, a3+b1, b2+b3. GNU prints a1+a2,
b1+b2.

Add coverage for line numbers, $, ranges, N across file boundaries,
hold space, Q, backup suffixes, and -n.
2026-09-25 15:16:35 +02:00
Jorge Polanco e5474abccf sed: implement the GNU R command (read one line from a file)
The R command reads one line at a time from a named file. All R commands
naming the same file share a single cursor so they read successive lines,
matching GNU sed. Rejected under --sandbox like the other file commands.

Includes unit and integration tests. Makes the GNU sed testsuite `cmd-R`
test pass.
2026-09-25 09:00:25 +02:00
renovate[bot] 961835e509 Update Rust crate rustix to v1.1.5 2026-09-25 07:14:17 +02:00
renovate[bot] 4a73dfb60c Update Rust crate clap_complete to v4.6.11 2026-09-25 07:13:41 +02:00
renovate[bot] a1a146a720 Update Rust crate clap to v4.6.7 2026-09-25 07:12:53 +02:00
Daniel Hofstetter c46dd6dab6 Bump cargo-dist from 0.30.3 to 0.33.0 (#556) 2026-09-21 14:17:18 +02:00
renovate[bot] fcab8f1ca7 Update Rust crate rand to v0.10.3 2026-09-21 07:34:32 +02:00
renovate[bot] cffecd151f Update Rust crate uutests to 0.12.0 2026-09-18 07:40:05 +02:00
renovate[bot] 0339313d49 Update Rust crate uucore to 0.12.0 2026-09-18 07:27:53 +02:00
renovate[bot] cffcc0c806 Update Rust crate divan to v5.0.2 2026-09-18 07:18:34 +02:00
renovate[bot] 643266bc93 Update Rust crate uufuzz to 0.12.0 2026-09-18 07:11:50 +02:00
renovate[bot] 81cf88e601 Update Rust crate console to v0.16.6 2026-09-13 09:44:23 +02:00
Daniel Hofstetter cc5e214878 Bump chacha20 from 0.10.0 to 0.10.2 (#553)
because version 0.10.0 got yanked
2026-09-09 11:32:26 +02:00
Daniel Hofstetter e4a923ac98 Bump getrandom from 0.4.2 to 0.4.3 (#554) 2026-09-09 11:31:56 +02:00
renovate[bot] 77f442ddc2 Update Rust crate uutests to 0.11.0 2026-09-01 15:18:47 +02:00
renovate[bot] dc2ec59ce7 Update Rust crate uufuzz to 0.11.0 2026-09-01 15:05:30 +02:00
renovate[bot] 08b8594355 Update Rust crate uucore to 0.11.0 2026-09-01 13:54:34 +02:00
Diomidis Spinellis f1c5813aa4 Make Unicode listing GNU-sed compatible (#537)
Adjust `l` command to list Unicode characters by default as
octal byte sequences of the corresponding UTF-8 bytes.
A new -U --uutil-extensions option allows listing them
with the common Unicode \u and \U hex escapes.
2026-08-29 23:24:09 +02:00
Sylvestre Ledru 32537dd5d9 ci: generate multibyte locales for the GNU testsuite (#539)
Without en_US.UTF-8, ru_RU.UTF-8 and el_GR.iso88597 the testsuite silently
skips eight multibyte tests, hiding both regressions and improvements.
Also make require_el_iso88597_locale_ probe locale -a instead of always
skipping.
2026-08-27 08:22:48 +02:00
Diomidis SpinellisandMukunda Katta b038f8fb2d Implement GNU W (write pattern first line) command (#531)
While at it, also fix the w command on patterns missing a newline.

Co-authored-by: Mukunda Katta <mukunda.vjcs6@gmail.com>
2026-08-26 16:29:57 +02:00