From: Erik Faye-Lund Date: Wed, 14 Dec 2011 14:07:09 GMT Subject: [PATCH v2 2/4] compat/setenv.c: error if name contains '=' Message-ID: <1323871631-2872-3-git-send-email-kusmabite@gmail.com> In-Reply-To: <1323871631-2872-1-git-send-email-kusmabite@gmail.com> According to POSIX, setenv should error out with EINVAL if it's asked to set an environment variable whose name contains an equals sign. Implement this detail in our compatibility-fallback. Signed-off-by: Erik Faye-Lund --- compat/setenv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/compat/setenv.c b/compat/setenv.c index 89947b7..fc1439a 100644 --- a/compat/setenv.c +++ b/compat/setenv.c @@ -6,7 +6,7 @@ int gitsetenv(const char *name, const char *value, int replace) size_t namelen, valuelen; char *envstr; - if (!name || !value) { + if (!name || strchr(name, '=') || !value) { errno = EINVAL; return -1; } -- 1.7.7.1.msysgit.0.272.g9e47e