fix(pty_proc/macOS): Properly set the environment for the child

Binding _NSGetEnviron()'s return value to a local variable and then
re-binding that is incorrect.  We need to directly update what
_NSGetEnviron() refers to.
This commit is contained in:
James McCoy 2021-01-31 07:49:31 -05:00
parent db734ae994
commit 035ee868ae
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB

View File

@ -159,7 +159,7 @@ static void init_child(PtyProcess *ptyproc)
FUNC_ATTR_NONNULL_ALL
{
#if defined(HAVE__NSGETENVIRON)
char **environ = *_NSGetEnviron();
#define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif