summaryrefslogtreecommitdiff
path: root/core/sam_edit.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/sam_edit.zig')
-rw-r--r--core/sam_edit.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/sam_edit.zig b/core/sam_edit.zig
index 4d7d6a27..0f4a70ba 100644
--- a/core/sam_edit.zig
+++ b/core/sam_edit.zig
@@ -85,6 +85,8 @@ pub const World = struct {
refuseGet: *const fn (ctx: *anyopaque, id: usize, why: *Why) bool,
/// What `~` is: the session's home (null: none).
home: ?[]const u8 = null,
+ /// The session's tape, which a `~user` read goes through (none: nobody's).
+ tape: *@import("tape.zig").Tape = &@import("tape.zig").none,
};
/// What an Edit came to: every file (those `B` opened after the ones it
@@ -670,7 +672,7 @@ const Exec = struct {
fn pathIn(ex: *Exec, fi: usize, name_in: []const u8) Failure![]const u8 {
// `~` and `~user` as Get, Incl and Save read them.
var home: [4096]u8 = undefined;
- const name = try ex.arena.dupe(u8, @import("fs.zig").expandHomeFrom(name_in, &home, if (ex.world) |w| w.home else null));
+ const name = try ex.arena.dupe(u8, @import("fs.zig").expandHomeFrom(if (ex.world) |w| w.tape else &@import("tape.zig").none, name_in, &home, if (ex.world) |w| w.home else null));
if (name.len > 0 and name[0] == '/') return name;
const dir = std.Io.Dir.path.dirnamePosix(ex.files.items[fi].name) orelse "/";
return std.Io.Dir.path.resolvePosix(ex.arena, &.{ dir, name });