Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-10-30 00:42:12 +0300
committerJunio C Hamano <gitster@pobox.com>2021-10-30 01:00:58 +0300
commita38989bd5bc850900667ae1b3c0cd43797b066f0 (patch)
treeb62ec1f246e8ddc5d7117adc1863f35507893e8d /compat/unsetenv.c
parentaf6d1d602a8f64164b266364339c4e936d5bbc33 (diff)
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>
Diffstat (limited to 'compat/unsetenv.c')
-rw-r--r--compat/unsetenv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/compat/unsetenv.c b/compat/unsetenv.c
index bf5fd7063b..b9d34af613 100644
--- a/compat/unsetenv.c
+++ b/compat/unsetenv.c
@@ -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;
}