summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/exec.zig b/src/exec.zig
index 7d682d74..d114dbf8 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -295,9 +295,10 @@ pub fn saveTo(p: *Pardes, id: usize, path: []const u8) void {
if (path.len == 0 or path[path.len - 1] == '/' or
std.mem.indexOfScalar(u8, path, '\n') != null)
return p.reportError(id, "save", error.NoFilename);
+ var home_buf: [4096]u8 = undefined;
const full = std.fs.path.resolvePosix(
p.scratch.allocator(),
- &.{ Pardes.paneDir(pane), path },
+ &.{ Pardes.paneDir(pane), @import("fs.zig").expandHome(path, &home_buf) },
) catch return;
if (!std.fs.path.isAbsolute(full)) return p.reportError(id, "save", error.NoDirectory);
if (full.len > Pardes.SavePath.cap) return p.reportError(id, "save", error.PathTooLong);