Skip to content

Commit f1e2a48

Browse files
tsunagitster
authored andcommitted
Revert "compat/unsetenv.c: Fix a sparse warning"
This reverts commit ec535cc. POSIX explicitly states "the [environ] variable, which must be declared by the user if it is to be used directly". Not declaring it causes compilation to fail on OS X. Instead don't declare the variable on MinGW, as it causes a spurious warning there. Signed-off-by: Benoit Sigoure <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 84d32bf commit f1e2a48

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compat/unsetenv.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
void gitunsetenv (const char *name)
44
{
5+
#if !defined(__MINGW32__)
6+
extern char **environ;
7+
#endif
58
int src, dst;
69
size_t nmln;
710

0 commit comments

Comments
 (0)