From a550753fb60be3cdc040c521ddaab9022f5d3248 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 09:11:37 -0300 Subject: Every EINVAL a write gets says why; DEL in an exec or look line is a control character An empty name, a word written to log other than follow, a data, sel, dot or dirty write to a pane with no text, a truncate other than to zero, and a control character in a look line written through a held open were refused with no words, logged as `Invalid argument`. Each says its reason now; and DEL is refused in exec and look lines as in names. Co-Authored-By: Claude Opus 5.5 --- src/ninep/tree.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ninep/tree.zig') diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index ed0e0352..391847f5 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -1007,7 +1007,7 @@ fn write(p: *Pardes, req: Req, target: Target) Reply { if (o.what != .lines and o.what != .ctl) return writeNow(p, req, target); // A clicked line holds no control character: refused at once, not held // to fail unseen at the close. - if (resultsFile(target)) for (req.data) |c| if (c < ' ' and c != '\t' and c != '\n' and c != '\r') return Reply.fail(req.tag, E.INVAL); + if (resultsFile(target)) for (req.data) |c| if ((c < ' ' and c != '\t' and c != '\n' and c != '\r') or c == 0x7f) return failText(req.tag, E.INVAL, ctl.e_control); o.pending.appendSlice(p.gpa, req.data) catch return Reply.fail(req.tag, E.NOMEM); const end = ctl.completeEnd(p, o.pending.items); if (end == 0) { -- cgit v1.3