unsetenv(3) returns int, not void
This compatilibity implementation has been returning a wrong type,
ever since 731043fd
(Add compat/unsetenv.c ., 2006-01-25) added to
the system, yet nobody noticed it in the past 16 years, presumably
because no code checks failures in their unsetenv() calls. Sigh.
For now, make it always succeed.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
af6d1d602a
commit
a38989bd5b
@ -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;
|
||||||
}
|
}
|
||||||
|
@ -726,7 +726,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
|
||||||
|
Loading…
Reference in New Issue
Block a user