Skip to content

Commit

Permalink
Revert "compat/unsetenv.c: Fix a sparse warning"
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
tsuna authored and gitster committed Jul 21, 2013
1 parent 84d32bf commit f1e2a48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compat/unsetenv.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

void gitunsetenv (const char *name)
{
#if !defined(__MINGW32__)
extern char **environ;
#endif
int src, dst;
size_t nmln;

Expand Down

0 comments on commit f1e2a48

Please sign in to comment.