summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-04 23:55:47 -0300
committerGabriel Schneider <[email protected]>2026-11-05 01:00:03 -0300
commit39886b26483128f4bc4c85c4e6cf0f7a7acf04ed (patch)
tree5cd9d63158fe584bcb308dd7fbf54a12130bcdc8 /src/ninep/pane.zig
parent1c7fd4c48f61695f396765c2f273b560a2e19963 (diff)
downloadpardes-39886b26483128f4bc4c85c4e6cf0f7a7acf04ed.tar.gz
pardes-39886b26483128f4bc4c85c4e6cf0f7a7acf04ed.zip
ninep: Messages is made with a literal, not its one-line init; writePager's two hosted-and-local guards are one; events' shownAs drops an alias of its argument and flag_expansion, which nothing reads, goes; doc comments sit on their own functions and fields again (noteError's, notePath's, writeEvent's, expandAt's in four fragments; Namespace's late_failure, batch and header_rewrite, whose key is a column's serial) and pane.zig's say what a name takes, blanks and controls included, as the reference does
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index 48095c46..90934791 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -854,20 +854,14 @@ fn writeFlag(p: *Pardes, req: Req, pane: *Pane, file: PaneFile) Reply {
return .{ .tag = req.tag, .written = @intCast(req.data.len) };
}
-/// Writing `name` renames the buffer: a relative name resolves against the
-/// pane's directory, as the tag's name field does.
-/// acme's refusal of a name with a blank or a control character in it
-/// (editors/acme/xfid.c:650-652). A blank inside a name is taken here, as
-/// pardes names files with spaces; one at either end is refused, not
-/// quietly cut off, so the name a script wrote is the name it gets.
+/// acme's words for a name it refuses (editors/acme/xfid.c:650-652), the
+/// reason after them.
pub const e_name_char = "bad character in file name";
-/// Why `name` is not one file name, with the reason, or null: a newline, a
-/// control byte, DEL or a C1 control (U+0080-U+009F), a blank at either
-/// end, or bytes that are not UTF-8.
-/// What no file name can hold, said: a newline (a name is one line) and
-/// a NUL. Any other byte a file system takes is taken, controls and bytes
-/// not UTF-8 included, so a name read from `name` writes back as it was.
+/// What no file name can hold, said: a newline (a name is one line), a
+/// NUL, a component over 255 bytes. Any other byte a file system takes is
+/// taken, blanks, controls and bytes not UTF-8 included, so a name read
+/// from `name` writes back as it was.
fn nameFault(name: []const u8) ?[]const u8 {
if (std.mem.indexOfScalar(u8, name, '\n') != null) return e_name_char ++ ": a newline (a name is one line)";
if (std.mem.indexOfScalar(u8, name, 0) != null) return e_name_char ++ ": a NUL";
@@ -895,6 +889,8 @@ pub fn heldNameFault(p: *Pardes, serial: u32, held: []const u8) ?[]const u8 {
return null;
}
+/// Writing `name` renames the buffer: a relative name resolves against the
+/// pane's directory, as the tag's name field does.
fn writeName(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply {
// One name: its newline ends it, as `echo` writes it, and it is one.
const name = if (std.mem.endsWith(u8, req.data, "\n")) req.data[0 .. req.data.len - 1] else req.data;