diff options
-rw-r--r-- | build-id | 2 | ||||
-rw-r--r-- | src/which.zig | 3 |
2 files changed, 2 insertions, 3 deletions
@@ -1 +1 @@ -61 +62 diff --git a/src/which.zig b/src/which.zig index 50c82c05d..69377df63 100644 --- a/src/which.zig +++ b/src/which.zig @@ -9,8 +9,7 @@ fn isValid(buf: *[std.fs.MAX_PATH_BYTES]u8, segment: []const u8, bin: []const u8 var stat = std.mem.zeroes(std.os.Stat); // we cannot use access() here even though all we want to do now here is check it is executable // directories can be considered executable - if (std.c.stat(filepath, &stat) != 0) return null; - if (stat.mode & std.os.S_IXUSR == 0 or !(std.os.S_ISLNK(stat.mode) or std.os.S_ISREG(stat.mode))) return null; + std.os.accessZ(filepath, std.os.X_OK) catch return null; return @intCast(u16, filepath.len); } |