summaryrefslogtreecommitdiff
path: root/src/ninep/tree.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 09:11:37 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commita550753fb60be3cdc040c521ddaab9022f5d3248 (patch)
tree9d392076f417b6a9d53b6a1bc9ce7fe44d4e499b /src/ninep/tree.zig
parent4d4818f7baf356866d323e4b337a64a3dddd8adb (diff)
downloadpardes-a550753fb60be3cdc040c521ddaab9022f5d3248.tar.gz
pardes-a550753fb60be3cdc040c521ddaab9022f5d3248.zip
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 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
-rw-r--r--src/ninep/tree.zig2
1 files changed, 1 insertions, 1 deletions
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) {