diff options
Diffstat (limited to 'src/builtins.zig')
| -rw-r--r-- | src/builtins.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/builtins.zig b/src/builtins.zig index 6aabba8d..6688d05f 100644 --- a/src/builtins.zig +++ b/src/builtins.zig @@ -666,7 +666,11 @@ pub const Restore = struct { pub const scope: Scope = .session; pub const takes_arg = true; pub fn run(c: Ctx) void { - const path = c.arg orelse (c.p.last_dump orelse return c.p.reportFailure(c.id, "Restore: no dump yet; name one")); + const typed = c.arg orelse (c.p.last_dump orelse return c.p.reportFailure(c.id, "Restore: no dump yet; name one")); + // The file it reads, whole (`~`, the DumpDir, the directory it runs + // in): what the log's `restore` record and every message name. + var full_buf: [4096]u8 = undefined; + const path = if (comptime pardes.hosted) @import("fs.zig").restorePath(typed, c.p.settings.dump_dir.get(), &full_buf) else typed; if (path.len > c.p.restore_buf.len) return c.p.reportFailure(c.id, "Restore: that name is too long"); // A dump that cannot be read is said now, and fails a ctl write: the // host reads it only after this step, where nobody hears. First, |
