aboutsummaryrefslogtreecommitdiff
path: root/src/which.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/which.zig')
-rw-r--r--src/which.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/which.zig b/src/which.zig
index e6ec2c74d..71120f3d1 100644
--- a/src/which.zig
+++ b/src/which.zig
@@ -10,7 +10,7 @@ fn isValid(buf: *[std.fs.MAX_PATH_BYTES]u8, segment: []const u8, bin: []const u8
// 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 stat.mode & std.os.S_IFREG == 0) return null;
+ if (stat.mode & std.os.S_IXUSR == 0 or (stat.mode & std.os.S_IFREG == 0 and stat.mode & std.os.S_ISLNK == 0)) return null;
return @intCast(u16, filepath.len);
}