Skip to content

Commit 4e6b0bd

Browse files
etiennebarriebyroot
andcommitted
env
Co-authored-by: Jean Boussier <[email protected]>
1 parent 48057b5 commit 4e6b0bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

process.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4632,7 +4632,11 @@ rb_posix_spawn(struct rb_execarg *eargp)
46324632
}
46334633

46344634
char **argv = ARGVSTR2ARGV(eargp->invoke.cmd.argv_str);
4635-
pid = posix_spawn(&pid, abspath, NULL, NULL, argv, NULL);
4635+
4636+
VALUE envp_str = eargp->envp_str;
4637+
char **envp = RTEST(envp_str) ? RB_IMEMO_TMPBUF_PTR(envp_str) : NULL;
4638+
4639+
pid = posix_spawn(&pid, abspath, NULL, NULL, argv, envp);
46364640

46374641
return (rb_pid_t)pid;
46384642
}

0 commit comments

Comments
 (0)