From 4ce36a64755b4b2ca8bb28e3ac91b23dfe90ade8 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 18 Jun 2018 12:18:39 -0400 Subject: [PATCH] adjust logic for finding the path to zig executable on darwin --- src/os.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/os.cpp b/src/os.cpp index 75f748e2f0..14e9effb1e 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -1004,10 +1004,10 @@ int os_self_exe_path(Buf *out_path) { // Resolve the real path from that. buf_resize(out_path, PATH_MAX); char *real_path = realpath(buf_ptr(tmp), buf_ptr(out_path)); - assert(real_path == buf_ptr(out_path)); - - // Deallocate our scratch space. - buf_deinit(tmp); + if (!real_path) { + buf_init_from_buf(out_path, tmp); + return 0; + } // Resize out_path for the correct length. buf_resize(out_path, strlen(buf_ptr(out_path)));