aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.handmade.network+github@gmail.com>2025-05-06 17:45:06 +0800
committerBrian <brian.handmade.network+github@gmail.com>2025-05-06 17:45:06 +0800
commit27edbc5a76cf4dae1bc276f2972a018bb831fc8c (patch)
treecfd9f8fab7a81f1e8a06a60453412317775d51bd
parent8032db348411ae85397441de7f2ce9ebd1029112 (diff)
Fix: Correct value cloning in os2._set_env for POSIX
The _set_env procedure in core/os/os2/env_posix.odin was incorrectly cloning the 'key' argument for 'cval' instead of the 'value' argument. This resulted in set_env effectively setting the environment variable's value to its own key. This commit corrects the typo to use the 'value' argument.
-rw-r--r--core/os/os2/env_posix.odin2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/os/os2/env_posix.odin b/core/os/os2/env_posix.odin
index 9661768b4..35084893a 100644
--- a/core/os/os2/env_posix.odin
+++ b/core/os/os2/env_posix.odin
@@ -30,7 +30,7 @@ _set_env :: proc(key, value: string) -> (err: Error) {
TEMP_ALLOCATOR_GUARD()
ckey := strings.clone_to_cstring(key, temp_allocator()) or_return
- cval := strings.clone_to_cstring(key, temp_allocator()) or_return
+ cval := strings.clone_to_cstring(value, temp_allocator()) or_return
if posix.setenv(ckey, cval, true) != nil {
err = _get_platform_error_from_errno()