ci: fix macos build

pull/12550/head
Delyan Angelov 2021-11-22 11:07:26 +02:00
parent fe48380e85
commit 84aa05f8fb
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 4 deletions

View File

@ -646,13 +646,13 @@ pub fn executable() string {
final_len := C.GetFinalPathNameByHandleW(file, unsafe { &u16(final_path) }, final_len := C.GetFinalPathNameByHandleW(file, unsafe { &u16(final_path) },
size, 0) size, 0)
if final_len < size { if final_len < size {
ret := unsafe { string_from_wide2(&u16(final_path), final_len) } sret := unsafe { string_from_wide2(&u16(final_path), final_len) }
defer { defer {
unsafe { ret.free() } unsafe { sret.free() }
} }
// remove '\\?\' from beginning (see link above) // remove '\\?\' from beginning (see link above)
ret_slice := ret[4..] sret_slice := sret[4..]
res := ret_slice.clone() res := sret_slice.clone()
return res return res
} else { } else {
eprintln('os.executable() saw that the executable file path was too long') eprintln('os.executable() saw that the executable file path was too long')