authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-09-28 18:45:50-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-09-28 18:45:50-04:00
log40da2c6098f3ac2e04117ff132313f2646e68d4a
treec721569662711fcc6a6769071649e0b570441445
parente242f6a609eb4d8367e2bf22ce82e210df3142bb
parent779881b978e1275eef2e3b247ec0909260f4219e
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #1599 from ziglang/zig-build-arg0

zig build: use os_self_exe_path to determine exe path not arg0

1 files changed, 6 insertions(+), 1 deletions(-)

src/main.cpp+6-1
......@@ -394,7 +394,12 @@ int main(int argc, char **argv) {
394394 bool no_rosegment_workaround = false;
395395
396396 if (argc >= 2 && strcmp(argv[1], "build") == 0) {
397 const char *zig_exe_path = arg0;
397 Buf zig_exe_path_buf = BUF_INIT;
398 if ((err = os_self_exe_path(&zig_exe_path_buf))) {
399 fprintf(stderr, "Unable to determine path to zig's own executable\n");
400 return EXIT_FAILURE;
401 }
402 const char *zig_exe_path = buf_ptr(&zig_exe_path_buf);
398403 const char *build_file = "build.zig";
399404 bool asked_for_help = false;
400405