diff options
Diffstat (limited to 'core/ninep')
| -rw-r--r-- | core/ninep/ctl.zig | 10 | ||||
| -rw-r--r-- | core/ninep/pane.zig | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig index 81600582..a4f16597 100644 --- a/core/ninep/ctl.zig +++ b/core/ninep/ctl.zig @@ -571,7 +571,7 @@ fn checkBuiltin(p: *Pardes, req: Req, line: []const u8, scope: builtins.Scope) ? .callstack_depth => arg.len == 0 or (std.fmt.parseInt(u8, arg, 10) catch 0) -% 1 < pardes.lsp.callstack_max_depth, else => probe: { var probe = p.settings; - break :probe probe.apply(setting, if (arg.len > 0) arg else null, p.sessionHome()); + break :probe probe.apply(p.tape, setting, if (arg.len > 0) arg else null, p.sessionHome()); }, }; if (takes) return null; @@ -679,13 +679,13 @@ pub fn writePager(p: *Pardes, req: Req) Reply { } if (dir.len > 0) if (pardes.filesystem.localPath(dir)) |local| { // A file there is no directory, ENOTDIR; nothing there, ENOENT. - if (exec_line.kindOf(local) != .directory) { - if (exec_line.kindOf(local) != null) + if (exec_line.kindOf(p.tape, local) != .directory) { + if (exec_line.kindOf(p.tape, local) != null) return tree.failText(req.tag, E.NOTDIR, std.fmt.bufPrint(&p.fs.ename, "pager: {s}: not a directory", .{dir[0..@min(dir.len, 256)]}) catch &p.fs.ename); // cut to ename's 320 return tree.failText(req.tag, E.NOENT, std.fmt.bufPrint(&p.fs.ename, "pager: {s}: no such directory", .{dir[0..@min(dir.len, 256)]}) catch &p.fs.ename); // cut to ename's 320 } // Nor one that may not be written, as a file's name there is refused. - if (pardes.filesystem.deniedAbove(local)) + if (p.tape.value(.denied, pardes.filesystem.deniedAbove, .{local})) return tree.failText(req.tag, E.PERM, std.fmt.bufPrint(&p.fs.ename, "pager: {s}: permission denied", .{dir[0..@min(dir.len, 256)]}) catch &p.fs.ename); // cut to ename's 320 }; const id = pardes.panes.Output.openPager(p, p.view().active, dir) catch |err| @@ -773,7 +773,7 @@ pub fn writeRoot(p: *Pardes, req: Req) Reply { if (!apply) continue; // ponytail: read on the 9P task, a small local file; a big // one would want pardes.turn's yield. - const bytes = fs.readFile(p.gpa, path) catch |err| return refuseQuoting(p, req, @errorName(err), path, ""); + const bytes = fs.readFile(p.tape, p.gpa, path) catch |err| return refuseQuoting(p, req, @errorName(err), path, ""); defer p.gpa.free(bytes); _ = pardes.Handover.adopt(p, bytes) catch |err| return refuseQuoting(p, req, @errorName(err), path, ""); continue; diff --git a/core/ninep/pane.zig b/core/ninep/pane.zig index 16d7762a..96a50703 100644 --- a/core/ninep/pane.zig +++ b/core/ninep/pane.zig @@ -900,7 +900,7 @@ fn writeName(p: *Pardes, req: Req, id: usize, pane: *Pane) Reply { // A directory (`~`, `/`, `foo/`) is no file to name a pane after: a // Save could only fail. Said now, EISDIR. const is_dir = name[name.len - 1] == '/' or std.mem.eql(u8, full, "/") or - (if (fs.localPath(full)) |local| exec.kindOf(local) == .directory else false); + (if (fs.localPath(full)) |local| exec.kindOf(p.tape, local) == .directory else false); if (is_dir) return tree.failText(req.tag, E.ISDIR, std.fmt.bufPrint(&p.fs.ename, "name: {s} is a directory, not a file", .{full[0..@min(full.len, 256)]}) catch &p.fs.ename); // cut to ename's 320 nameBuffer(p, id, full, false) catch |err| return Reply.fail(req.tag, switch (err) { error.OutOfMemory => E.NOMEM, @@ -944,7 +944,7 @@ pub fn nameBuffer(p: *Pardes, id: usize, full: []const u8, preserve_tag: bool) ! p.emit(.{ .watch = .{ .pane = @intCast(id), .on = false } }); events.noteLog(p, .rename, pane); // A name given: whether a file there is on disk is the disk's to say. - f.on_disk = f.output == null and pardes.Pardes.recentKeeps(f.path); + f.on_disk = f.output == null and pardes.Pardes.recentKeeps(p.tape, f.path); if (f.on_disk) p.recent.opened(p.recentGpa(), f.path); } |
