diff options
Diffstat (limited to 'src/look.zig')
| -rw-r--r-- | src/look.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/look.zig b/src/look.zig index aee96513..0414f6d1 100644 --- a/src/look.zig +++ b/src/look.zig @@ -1295,9 +1295,9 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text: // that is gone, else the file named. if (filesystem.dotRelative(trimmed)) { const dir = Pardes.paneDir(pane); - var said: [4096 + 104]u8 = undefined; + var said: Kind.Buf(4096 + 104) = .{}; const gone = if (filesystem.localPath(dir)) |local| exec.kindOf(local) != .directory else false; - if (gone) return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch unreachable); // 4096 + 27 fits 4096 + 104 + if (gone) return p.reportFailure(id, said.print("look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]})); // A file not there is a miss, as `x` and `/abs/x` are: said and // logged, the write answered with nothing. var cut: [miss_path_cap + "…".len]u8 = undefined; @@ -1755,8 +1755,8 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void { // A directory that is not there (the pane's own, gone): said, // ENOENT, no terminal made in it. if (filesystem.localPath(dir)) |local| if (exec.kindOf(local) != .directory) { - var said: [4096 + 104]u8 = undefined; - return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch unreachable); // 4096 + 27 fits 4096 + 104 + var said: Kind.Buf(4096 + 104) = .{}; + return p.reportFailure(id, said.print("look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]})); }; // acme's: a pane listing it (Dir.zig). panes.Dir.look(p, id, dir); |
