aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-28 02:59:50 -0800
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-12-28 02:59:50 -0800
commit6d6b7f93f3ee11e7f1d2019c435232146faa3ed8 (patch)
tree440bcb9fab379d03b65c0cda4e7028e6f488dea1
parent0d95cf8f5b8c54bf47df3bf3087527f808f9d0e4 (diff)
downloadbun-6d6b7f93f3ee11e7f1d2019c435232146faa3ed8.tar.gz
bun-6d6b7f93f3ee11e7f1d2019c435232146faa3ed8.tar.zst
bun-6d6b7f93f3ee11e7f1d2019c435232146faa3ed8.zip
[bun run] Fix breaking bug
-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);
}