aboutsummaryrefslogtreecommitdiff
path: root/lib/std/process.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-19 10:10:59 -0500
committerGitHub <noreply@github.com>2023-02-19 10:10:59 -0500
commit0bb178bbb2451238a326c6e916ecf38fbc34cab1 (patch)
treeb2499481c929ba1497d6eef8b85cc46205f953ab /lib/std/process.zig
parent346ec15c5005e523c2a1d4b967ee7a4e5d1e9775 (diff)
parent5fc6bbe71eeecb195d2cda2a2522e7fd04749d5b (diff)
downloadzig-0bb178bbb2451238a326c6e916ecf38fbc34cab1.tar.gz
zig-0bb178bbb2451238a326c6e916ecf38fbc34cab1.zip
Merge pull request #14671 from ziglang/multi-object-for
implement multi-object for loops
Diffstat (limited to 'lib/std/process.zig')
-rw-r--r--lib/std/process.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/process.zig b/lib/std/process.zig
index b901a9f0fa..777bcbbab0 100644
--- a/lib/std/process.zig
+++ b/lib/std/process.zig
@@ -874,7 +874,7 @@ pub fn argsAlloc(allocator: Allocator) ![][:0]u8 {
mem.copy(u8, result_contents, contents_slice);
var contents_index: usize = 0;
- for (slice_sizes) |len, i| {
+ for (slice_sizes, 0..) |len, i| {
const new_index = contents_index + len;
result_slice_list[i] = result_contents[contents_index..new_index :0];
contents_index = new_index + 1;
@@ -1148,7 +1148,7 @@ pub fn execve(
const arena = arena_allocator.allocator();
const argv_buf = try arena.allocSentinel(?[*:0]u8, argv.len, null);
- for (argv) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr;
+ for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr;
const envp = m: {
if (env_map) |m| {