From 7e2c433abc64faa8ecc01f62d84dde1c7b20782b Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sun, 14 Feb 2021 14:34:52 -0600 Subject: [PATCH] Fix #636 --- src/core/os.c | 1 - test/suite0010.janet | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) 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)