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"
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)
++dst;
}
environ[dst] = NULL;
return 0;
}

View File

@ -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