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
This commit is contained in:
Junio C Hamano 2021-11-29 15:41:48 -08:00
commit 0ae87432aa
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,6 @@
#include "../git-compat-util.h" #include "../git-compat-util.h"
void gitunsetenv (const char *name) int gitunsetenv(const char *name)
{ {
#if !defined(__MINGW32__) #if !defined(__MINGW32__)
extern char **environ; extern char **environ;
@ -24,4 +24,6 @@ void gitunsetenv (const char *name)
++dst; ++dst;
} }
environ[dst] = NULL; environ[dst] = NULL;
return 0;
} }

View file

@ -729,7 +729,7 @@ char *gitmkdtemp(char *);
#ifdef NO_UNSETENV #ifdef NO_UNSETENV
#define unsetenv gitunsetenv #define unsetenv gitunsetenv
void gitunsetenv(const char *); int gitunsetenv(const char *);
#endif #endif
#ifdef NO_STRCASESTR #ifdef NO_STRCASESTR