diff --git a/src/core/os.c b/src/core/os.c index a9efb05a..ea5d5010 100644 --- a/src/core/os.c +++ b/src/core/os.c @@ -395,7 +395,7 @@ typedef struct { static JanetEVGenericMessage janet_proc_wait_subr(JanetEVGenericMessage args) { JanetProc *proc = (JanetProc *) args.argp; WaitForSingleObject(proc->pHandle, INFINITE); - GetExitCodeProcess(proc->pHandle, &args.argi); + GetExitCodeProcess(proc->pHandle, &args.tag); return args; } diff --git a/test/suite0011.janet b/test/suite0011.janet index a4d40495..67fa709e 100644 --- a/test/suite0011.janet +++ b/test/suite0011.janet @@ -50,5 +50,9 @@ (assert (= (hash 0) (hash (* -1 0))) "hash -0 same as hash 0") +# os/execute regressions +(for i 0 10 + (assert (= i (os/execute [(dyn :executable) "-e" (string/format "(os/exit %d)" i)] :p)) (string "os/execute " i))) + (end-suite)