Browse Source

Merge branch 'jc/unsetenv-returns-an-int'

The compatibility implementation for unsetenv(3) were written to
mimic ancient, non-POSIX, variant seen in an old glibc; it has been
changed to return an integer to match the more modern era.

* jc/unsetenv-returns-an-int:
  unsetenv(3) returns int, not void
maint
Junio C Hamano 3 years ago
parent
commit
0ae87432aa
  1. 4
      compat/unsetenv.c
  2. 2
      git-compat-util.h

4
compat/unsetenv.c

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
#include "../git-compat-util.h"

void gitunsetenv (const char *name)
int gitunsetenv(const char *name)
{
#if !defined(__MINGW32__)
extern char **environ;
@ -24,4 +24,6 @@ void gitunsetenv (const char *name) @@ -24,4 +24,6 @@ void gitunsetenv (const char *name)
++dst;
}
environ[dst] = NULL;

return 0;
}

2
git-compat-util.h

@ -729,7 +729,7 @@ char *gitmkdtemp(char *); @@ -729,7 +729,7 @@ char *gitmkdtemp(char *);

#ifdef NO_UNSETENV
#define unsetenv gitunsetenv
void gitunsetenv(const char *);
int gitunsetenv(const char *);
#endif

#ifdef NO_STRCASESTR

Loading…
Cancel
Save