summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3ae4a86)
raw | patch | inline | side by side (parent: 3ae4a86)
author | Matthias Lederhofer <matled@gmx.net> | |
Wed, 6 Jun 2007 21:29:59 +0000 (23:29 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 6 Jun 2007 23:07:53 +0000 (16:07 -0700) |
Additionally there was a similar part calling setenv and getenv
in the same way which missed a check if getenv succeeded.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in the same way which missed a check if getenv succeeded.
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c | patch | blob | history |
index 14a4d955b5bec90251f2c464d4086b08945b8b59..dba8012659cf85fa96cad4fcbc55e377c7e876b9 100644 (file)
--- a/setup.c
+++ b/setup.c
die("Not a git repository");
}
setenv(GIT_DIR_ENVIRONMENT, cwd, 1);
+ gitdirenv = getenv(GIT_DIR_ENVIRONMENT);
+ if (!gitdirenv)
+ die("getenv after setenv failed");
}
if (PATH_MAX - 40 < strlen(gitdirenv)) {
if (gitdirenv[0] != '/') {
setenv(GIT_DIR_ENVIRONMENT, gitdir, 1);
gitdirenv = getenv(GIT_DIR_ENVIRONMENT);
+ if (!gitdirenv)
+ die("getenv after setenv failed");
if (PATH_MAX - 40 < strlen(gitdirenv)) {
if (nongit_ok) {
*nongit_ok = 1;