fix regression in zig run runtime arguments
This brings back #10950, which was reverted in 5ab5e2e673
because it [introduced a regression in `zig run`](https://github.com/ziglang/zig/pull/10950#issuecomment-1049481212)
where the runtime arguments passed were incorrect.
I've fixed the issue, and notably this was the only location where we
directly relied on accessing arguments by index in this code still (all
other locations use the iterator proper) and so we should be all good to
go now.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
@@ -799,9 +799,9 @@ fn buildOutputType(
|
||||
return cleanExit();
|
||||
} else if (mem.eql(u8, arg, "--")) {
|
||||
if (arg_mode == .run) {
|
||||
// The index refers to all_args so skip `zig` `run`
|
||||
// and `--`
|
||||
runtime_args_start = args_iter.i + 3;
|
||||
// args_iter.i is 1, referring the next arg after "--" in ["--", ...]
|
||||
// Add +2 to the index so it is relative to all_args
|
||||
runtime_args_start = args_iter.i + 2;
|
||||
break :args_loop;
|
||||
} else {
|
||||
fatal("unexpected end-of-parameter mark: --", .{});
|
||||
|
||||
Reference in New Issue
Block a user