Skip to content

Commit 4b04354

Browse files
committed
process.c: fix environ for macOS
1 parent 8afdad0 commit 4b04354

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/unix/process.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
#include "process.h"
1616
#include "strlist.h"
1717

18-
extern char **environ;
18+
#ifdef __APPLE__
19+
#include <crt_externs.h>
20+
#define environ (*_NSGetEnviron())
21+
#else
22+
extern char **environ;
23+
#endif
1924

2025
struct git_process {
2126
char **args;

0 commit comments

Comments
 (0)