summaryrefslogtreecommitdiff
path: root/src/look.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/look.zig')
-rw-r--r--src/look.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/look.zig b/src/look.zig
index f47f0b15..634310f1 100644
--- a/src/look.zig
+++ b/src/look.zig
@@ -1223,7 +1223,7 @@ fn lookOpenFailed(p: *Pardes, id: usize, path: []const u8, err: anyerror) void {
var cut: [miss_path_cap + "…".len]u8 = undefined;
// Not there, on a peer's mount as on this host: a miss, the write
// answered, as any path to no file is.
- const remote_missing = if (comptime pardes.hosted) err == error.Remote and std.mem.indexOf(u8, @import("9p_io.zig").Client.lastSaid(), "not exist") != null else false;
+ const remote_missing = err == error.Remote and std.mem.indexOf(u8, @import("9p_io.zig").Client.lastSaid(), "not exist") != null;
if (err == error.FileNotFound or err == error.NotFound or remote_missing)
return missed(p, id, "{s}: no such file", .{missText(path, &cut)});
var said: [miss_path_cap + 16]u8 = undefined;
@@ -1373,7 +1373,7 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text:
if (filesystem.dotRelative(trimmed)) {
const dir = Pardes.paneDir(pane);
var said: [4200]u8 = undefined;
- const gone = if (comptime pardes.hosted) if (filesystem.localPath(dir)) |local| exec.kindOf(local) != .directory else false else true;
+ 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 "look: no such directory");
// A file not there is a miss, as `x` and `/abs/x` are: said and
// logged, the write answered with nothing.
@@ -1411,7 +1411,6 @@ fn lookUnresolved(p: *Pardes, id: usize, pane: *Pane, trimmed: []const u8, text:
/// goes when it succeeds (exec.commandDone).
// ponytail: a hex word that names no commit leaves git's error in a command pane, not a search; check the object first if that bites.
fn lookCommit(p: *Pardes, id: usize, pane: *Pane, word: []const u8) bool {
- if (comptime !pardes.hosted) return false;
if (!isCommitHash(word)) return false;
var dir = filesystem.localPath(Pardes.paneDir(pane)) orelse return false;
while (true) {
@@ -1817,7 +1816,7 @@ pub fn lookAt(p: *Pardes, id: usize, operand_raw: []const u8) void {
.dir => |dir| {
// A directory that is not there (the pane's own, gone): said,
// ENOENT, no terminal made in it.
- if (comptime pardes.hosted) if (filesystem.localPath(dir)) |local| if (exec.kindOf(local) != .directory) {
+ if (filesystem.localPath(dir)) |local| if (exec.kindOf(local) != .directory) {
var said: [4200]u8 = undefined;
return p.reportFailure(id, std.fmt.bufPrint(&said, "look: {s}: no such directory", .{dir[0..@min(dir.len, 4096)]}) catch "look: no such directory");
};