From c4bc85b8da17ae2a191d0c73424e17fde8b6391e Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:32:20 -0300 Subject: A look of `./x` that is not there is a miss, as `x` and `/abs/x` are: the write answered, the err logged, not ENOENT `./x` and `../x` failed their write with ENOENT while every other name that opens nothing was a miss the write was still answered with. They are misses now too, said and logged `look: ./x: no such file`. A pane's own directory gone stays a failure. Co-Authored-By: Claude Opus 5.5 --- src/ninep/tree.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ninep/tree.zig') diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index e5d1c848..e566482c 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -495,14 +495,14 @@ test "a reason past 128 bytes keeps its end: the path in it gives up its middle" const words = "why " ** 40 ++ "the reason"; try testing.expect(std.mem.endsWith(u8, fitErr(words, &out), "the reason")); try testing.expectEqualStrings("short", fitErr("short", &out)); - // Through the tree: a look at a long ./ name not there says why at the end. + // Through the tree: a look at a long ./ name not there, a miss, says + // why at the end of its err record, the name giving up its middle. const p = try th.withFile(testing.allocator, "x\n"); defer p.deinit(); var line: [512]u8 = undefined; const r = th.wr(p, Node.of(serialOf(p), .look), try std.fmt.bufPrint(&line, "./{s}x.txt\n", .{"no-such-dir/" ** 20})); - try testing.expectEqual(Status.err, r.reply.status); - try testing.expect(r.reply.ename.len <= 128); - try testing.expect(std.mem.endsWith(u8, r.reply.ename, "no such file") or std.mem.endsWith(u8, r.reply.ename, "no such directory")); + try testing.expectEqual(Status.ok, r.reply.status); + try testing.expect(th.logHas(p, "x.txt: no such file")); } /// A refusal with no reason of its own said in Plan 9's words, not the C -- cgit v1.3