Skip to content

Commit 93c9444

Browse files
authored
Merge pull request libgit2#6792 from barracuda156/apple
process.c: fix environ for macOS
2 parents 9ddf612 + 4b04354 commit 93c9444

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)