aboutsummaryrefslogtreecommitdiff
path: root/lib/std/child_process.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-06-04 01:12:38 -0400
committerGitHub <noreply@github.com>2021-06-04 01:12:38 -0400
commit7d15a3ac71c5d8dc8c08dfd8ea8ad43d4eae188a (patch)
treeae007106526e300bb7143be003fe8d847ba7230c /lib/std/child_process.zig
parent87dae0ce98fde1957a9290c22866b3101ce419d8 (diff)
parent6953c8544b68c788dca4ed065e4a15eccbd4446b (diff)
downloadzig-7d15a3ac71c5d8dc8c08dfd8ea8ad43d4eae188a.tar.gz
zig-7d15a3ac71c5d8dc8c08dfd8ea8ad43d4eae188a.zip
Merge pull request #8975 from SpexGuy/hash-map-updates
Breaking hash map changes for 0.8.0
Diffstat (limited to 'lib/std/child_process.zig')
-rw-r--r--lib/std/child_process.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig
index a4ba12ef2f..56f3e9b1df 100644
--- a/lib/std/child_process.zig
+++ b/lib/std/child_process.zig
@@ -955,7 +955,7 @@ pub fn createWindowsEnvBlock(allocator: *mem.Allocator, env_map: *const BufMap)
while (it.next()) |pair| {
// +1 for '='
// +1 for null byte
- max_chars_needed += pair.key.len + pair.value.len + 2;
+ max_chars_needed += pair.key_ptr.len + pair.value_ptr.len + 2;
}
break :x max_chars_needed;
};
@@ -965,10 +965,10 @@ pub fn createWindowsEnvBlock(allocator: *mem.Allocator, env_map: *const BufMap)
var it = env_map.iterator();
var i: usize = 0;
while (it.next()) |pair| {
- i += try unicode.utf8ToUtf16Le(result[i..], pair.key);
+ i += try unicode.utf8ToUtf16Le(result[i..], pair.key_ptr.*);
result[i] = '=';
i += 1;
- i += try unicode.utf8ToUtf16Le(result[i..], pair.value);
+ i += try unicode.utf8ToUtf16Le(result[i..], pair.value_ptr.*);
result[i] = 0;
i += 1;
}
@@ -990,10 +990,10 @@ pub fn createNullDelimitedEnvMap(arena: *mem.Allocator, env_map: *const std.BufM
var it = env_map.iterator();
var i: usize = 0;
while (it.next()) |pair| : (i += 1) {
- const env_buf = try arena.allocSentinel(u8, pair.key.len + pair.value.len + 1, 0);
- mem.copy(u8, env_buf, pair.key);
- env_buf[pair.key.len] = '=';
- mem.copy(u8, env_buf[pair.key.len + 1 ..], pair.value);
+ const env_buf = try arena.allocSentinel(u8, pair.key_ptr.len + pair.value_ptr.len + 1, 0);
+ mem.copy(u8, env_buf, pair.key_ptr.*);
+ env_buf[pair.key_ptr.len] = '=';
+ mem.copy(u8, env_buf[pair.key_ptr.len + 1 ..], pair.value_ptr.*);
envp_buf[i] = env_buf.ptr;
}
assert(i == envp_count);
@@ -1007,11 +1007,11 @@ test "createNullDelimitedEnvMap" {
var envmap = BufMap.init(allocator);
defer envmap.deinit();
- try envmap.set("HOME", "/home/ifreund");
- try envmap.set("WAYLAND_DISPLAY", "wayland-1");
- try envmap.set("DISPLAY", ":1");
- try envmap.set("DEBUGINFOD_URLS", " ");
- try envmap.set("XCURSOR_SIZE", "24");
+ try envmap.put("HOME", "/home/ifreund");
+ try envmap.put("WAYLAND_DISPLAY", "wayland-1");
+ try envmap.put("DISPLAY", ":1");
+ try envmap.put("DEBUGINFOD_URLS", " ");
+ try envmap.put("XCURSOR_SIZE", "24");
var arena = std.heap.ArenaAllocator.init(allocator);
defer arena.deinit();