diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-29 09:13:55 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:16 -0300 |
| commit | 36241daca2aaf90cc8933dffd95fc3cd6216e2b7 (patch) | |
| tree | a24873db3188e64f699b828a764b813f29f02de6 /src/ninep/tree.zig | |
| parent | a550753fb60be3cdc040c521ddaab9022f5d3248 (diff) | |
| download | pardes-36241daca2aaf90cc8933dffd95fc3cd6216e2b7.tar.gz pardes-36241daca2aaf90cc8933dffd95fc3cd6216e2b7.zip | |
/index shows names as the log does, one line of UTF-8, and a newline in a name as \n
/index printed a name as it was, so a directory with a newline in it split
its row in two, and bytes not UTF-8 went through; the log turned the
newline into a space, silently another name. Both now show a name one
way: a newline `\n`, other controls, DEL and C1 a space, bytes not UTF-8
`\xNN`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index 391847f5..c089c31d 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -917,7 +917,11 @@ fn readFile(p: *Pardes, req: Req, target: Target) Reply { last = serial; const id = p.paneBySerial(serial).?; const pn = p.panes[id].?; - out.print(p.gpa, "{d} {s} {d} {s} {d}\n", .{ serial, pane.kindOf(pn), @intFromBool(pane.dirtyOf(pn)), pane.nameOf(pn), pane.columnOf(p, id) }) catch {}; + // A name as /log shows it: one line of UTF-8, a + // newline in it `\n` (events.shown). + var name_buf: [4 * 4096]u8 = undefined; + const name = events.shown(pane.nameOf(pn), &name_buf); + out.print(p.gpa, "{d} {s} {d} {s} {d}\n", .{ serial, pane.kindOf(pn), @intFromBool(pane.dirtyOf(pn)), name, pane.columnOf(p, id) }) catch {}; } break :index stagedReply(p, req); }, |
