| ... | ... | @@ -988,9 +988,13 @@ fn detectAbiAndDynamicLinker( |
| 988 | 988 | // if it finds one, then instead of using /usr/bin/env as the ELF file to examine, it uses the file it references instead, |
| 989 | 989 | // doing the same logic recursively in case it finds another shebang line. |
| 990 | 990 | |
| 991 | | // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a |
| 992 | | // reasonably reliable path to start with. |
| 993 | | var file_name: []const u8 = "/usr/bin/env"; |
| 991 | var file_name: []const u8 = switch (os.tag) { |
| 992 | // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a |
| 993 | // reasonably reliable path to start with. |
| 994 | else => "/usr/bin/env", |
| 995 | // Haiku does not have a /usr root directory. |
| 996 | .haiku => "/bin/env", |
| 997 | }; |
| 994 | 998 | // #! (2) + 255 (max length of shebang line since Linux 5.1) + \n (1) |
| 995 | 999 | var buffer: [258]u8 = undefined; |
| 996 | 1000 | while (true) { |