]> git.saurik.com Git - apple/libc.git/blame - stdlib/FreeBSD/getenv.c.patch
Libc-391.4.1.tar.gz
[apple/libc.git] / stdlib / FreeBSD / getenv.c.patch
CommitLineData
3d9156a7
A
1--- getenv.c.orig 2004-12-01 20:08:48.000000000 -0800
2+++ getenv.c 2004-12-01 20:10:20.000000000 -0800
3@@ -40,8 +40,9 @@
9385eb3d
A
4 #include <stdlib.h>
5 #include <stddef.h>
6 #include <string.h>
7+#include <crt_externs.h>
8
3d9156a7
A
9-inline char *__findenv(const char *, int *);
10+inline char *__findenv(const char *, int *) __attribute__((always_inline));
9385eb3d 11
3d9156a7
A
12 /*
13 * __findenv --
9385eb3d
A
14@@ -57,7 +58,7 @@
15 const char *name;
16 int *offset;
17 {
18- extern char **environ;
19+ char **environ = *_NSGetEnviron();
20 int len, i;
21 const char *np;
22 char **p, *cp;