| ... | ... | @@ -2192,13 +2192,13 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { |
| 2192 | 2192 | if (is_darwin) { |
| 2193 | 2193 | // Note that _NSGetExecutablePath() will return "a path" to |
| 2194 | 2194 | // the executable not a "real path" to the executable. |
| 2195 | | var symlink_path_buf: [MAX_PATH_BYTES]u8 = undefined; |
| 2195 | var symlink_path_buf: [MAX_PATH_BYTES:0]u8 = undefined; |
| 2196 | 2196 | var u32_len: u32 = MAX_PATH_BYTES; |
| 2197 | 2197 | const rc = std.c._NSGetExecutablePath(&symlink_path_buf, &u32_len); |
| 2198 | 2198 | if (rc != 0) return error.NameTooLong; |
| 2199 | 2199 | |
| 2200 | 2200 | var real_path_buf: [MAX_PATH_BYTES]u8 = undefined; |
| 2201 | | const real_path = try std.os.realpathZ(@ptrCast([*:0]u8, &symlink_path_buf), &real_path_buf); |
| 2201 | const real_path = try std.os.realpathZ(&symlink_path_buf, &real_path_buf); |
| 2202 | 2202 | if (real_path.len > out_buffer.len) return error.NameTooLong; |
| 2203 | 2203 | std.mem.copy(u8, out_buffer, real_path); |
| 2204 | 2204 | return out_buffer[0..real_path.len]; |