Skip to content

Commit 0ae8743

Browse files
committed
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
2 parents 5126145 + a38989b commit 0ae8743

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compat/unsetenv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "../git-compat-util.h"
22

3-
void gitunsetenv (const char *name)
3+
int gitunsetenv(const char *name)
44
{
55
#if !defined(__MINGW32__)
66
extern char **environ;
@@ -24,4 +24,6 @@ void gitunsetenv (const char *name)
2424
++dst;
2525
}
2626
environ[dst] = NULL;
27+
28+
return 0;
2729
}

git-compat-util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ char *gitmkdtemp(char *);
729729

730730
#ifdef NO_UNSETENV
731731
#define unsetenv gitunsetenv
732-
void gitunsetenv(const char *);
732+
int gitunsetenv(const char *);
733733
#endif
734734

735735
#ifdef NO_STRCASESTR

0 commit comments

Comments
 (0)