зеркало из https://github.com/microsoft/git.git
compat/setenv.c: error if name contains '='
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 <kusmabite@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
57590c72b4
Коммит
6ac1b2a3b8
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче