diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 12:35:40 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 2d9f40667197ac775d5215ffd164c800f83cab4c (patch) | |
| tree | 7db6fb0ead682803ad406909c3c2cb81def335d0 /src/ninep/addr.zig | |
| parent | d8b35f18817faaba340059cc2bd88ab3b3bc919b (diff) | |
| download | pardes-2d9f40667197ac775d5215ffd164c800f83cab4c.tar.gz pardes-2d9f40667197ac775d5215ffd164c800f83cab4c.zip | |
A pattern with a newline and an anchor mvzr would misread is refused EINVAL, as the doc says
Its words named no malformed input, so 9ns read the refusal as EIO, and Edit's failed EIO directly. It now says bad regular expression: ..., and Edit's failure with those words is EINVAL too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/addr.zig')
| -rw-r--r-- | src/ninep/addr.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ninep/addr.zig b/src/ninep/addr.zig index 09ef2b66..f60c07b1 100644 --- a/src/ninep/addr.zig +++ b/src/ninep/addr.zig @@ -377,6 +377,16 @@ test "an address is evaluated from the current one, as acme's are" { try testing.expectEqualStrings(e_order, th.wr(q, qaddr, "/a/,/b/").reply.ename); } +test "a pattern with a newline and an anchor mvzr would misread is refused EINVAL, by addr and by Edit" { + const p = try th.withFile(testing.allocator, "a\nfoo\n"); + defer p.deinit(); + const r = th.wr(p, Node.of(th.serialOf(p), .addr), "/(^|\\n)foo/"); + try testing.expectEqual(E.INVAL, r.errno()); + try testing.expectEqualStrings(regexp_.Regex.e_anchor, r.reply.ename); + const e = th.wr(p, Node.of(th.serialOf(p), .ctl), "Edit ,x/(^|\\n)foo/d\n"); + try testing.expectEqual(E.INVAL, e.errno()); +} + test "a row's range, L:C-L2:C2 or L:C-C2, is an address through its last character" { const p = try th.withFile(testing.allocator, "one\ntwo three\nfour\n"); defer p.deinit(); |
