diff --git a/src/core/os.c b/src/core/os.c index 4368bcd7..a16d472d 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -941,7 +941,6 @@ static Janet os_execute_impl(int32_t argc, Janet *argv, int is_spawn) { janet_unlock_environ(); } - /* Wait for child */ os_execute_cleanup(envp, child_argv); if (status) { janet_panicf("%p: %s", argv[0], strerror(errno)); diff --git a/test/suite0010.janet b/test/suite0010.janet index e541f35e..752bbad2 100644 --- a/test/suite0010.janet +++ b/test/suite0010.janet @@ -143,4 +143,7 @@ (assert (< 100 1e23) "greater than immediate 1") (assert (< 1000 1e23) "greater than immediate 2") +# os/execute with environment variables +(assert (= 0 (os/execute [(dyn :executable) "-e" "(+ 1 2 3)"] :pe {"HELLO" "WORLD"})) "os/execute with env") + (end-suite)