aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-07-20 01:15:46 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-07-20 07:25:05 +0200
commitc58cce799932a5b9a735ac359794ec8bcde61633 (patch)
tree2dde71a66c7a1f4b87739b80f3819a8a8a5c665d /lib/std/Build
parentb4fd57a9c114748afb9ba0a04bede61089a02ddf (diff)
downloadzig-c58cce799932a5b9a735ac359794ec8bcde61633.tar.gz
zig-c58cce799932a5b9a735ac359794ec8bcde61633.zip
std.Build.Step.Run: fix up 681d324c49e7cdc773cc891ea49ed69dd03c23c7
https://github.com/ziglang/zig/pull/24151/files#r2217494741
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Step/Run.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/std/Build/Step/Run.zig b/lib/std/Build/Step/Run.zig
index b4e2e73c0a..b8d1a3a9cb 100644
--- a/lib/std/Build/Step/Run.zig
+++ b/lib/std/Build/Step/Run.zig
@@ -1118,10 +1118,12 @@ fn runCommand(
// Wine's excessive stderr logging is only situationally helpful. Disable it by default, but
// allow the user to override it (e.g. with `WINEDEBUG=err+all`) if desired.
if (env_map.get("WINEDEBUG") == null) {
- // We don't own `env_map` at this point, so turn it into a copy before modifying it.
- env_map = arena.create(EnvMap) catch @panic("OOM");
- env_map.hash_map = try env_map.hash_map.cloneWithAllocator(arena);
- try env_map.put("WINEDEBUG", "-all");
+ // We don't own `env_map` at this point, so create a copy in order to modify it.
+ const new_env_map = arena.create(EnvMap) catch @panic("OOM");
+ new_env_map.hash_map = try env_map.hash_map.cloneWithAllocator(arena);
+ try new_env_map.put("WINEDEBUG", "-all");
+
+ env_map = new_env_map;
}
} else {
return failForeign(run, "-fwine", argv[0], exe);