diff options
| author | Tamas Kenez <tamas.kenez@shapr3d.com> | 2021-08-14 13:58:46 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-08-21 14:49:01 +0300 |
| commit | 4c18da1ef3ef21033394041be21774bf13882b54 (patch) | |
| tree | 19508d193e02a964728839080bea0333e8c2eab6 /src/main.zig | |
| parent | bbb96e112cc555fd63fe305398c5b89b778e9c81 (diff) | |
| download | zig-4c18da1ef3ef21033394041be21774bf13882b54.tar.gz zig-4c18da1ef3ef21033394041be21774bf13882b54.zip | |
Fix args when calling clang::ASTUnit::LoadFromCommandLine.
clang::ASTUnit::LoadFromCommandLine interprets the first argument as
the name of program (like the main function).
This change shifts the arguments passing "" for the first argument.
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 285b6d2316..44b3a0515c 100644 --- a/src/main.zig +++ b/src/main.zig @@ -2492,6 +2492,7 @@ fn cmdTranslateC(comp: *Compilation, arena: *Allocator, enable_cache: bool) !voi const digest = if (try man.hit()) man.final() else digest: { var argv = std.ArrayList([]const u8).init(arena); + try argv.append(""); // argv[0] is program name, actual args start at [1] var zig_cache_tmp_dir = try comp.local_cache_directory.handle.makeOpenPath("tmp", .{}); defer zig_cache_tmp_dir.close(); |
