summaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-08-04 15:46:19 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-08-04 18:30:19 (GMT)
commit3a3c3fc42a021f11aa8f35dc40cc69d4d4af7224 (patch)
tree7ee94de0501d77a2312de938f7d0e461f7269450 /setup.c
parent7e18e56920bd38ffc1f2c068d943bfd3f012473d (diff)
downloadgit-3a3c3fc42a021f11aa8f35dc40cc69d4d4af7224.zip
git-3a3c3fc42a021f11aa8f35dc40cc69d4d4af7224.tar.gz
git-3a3c3fc42a021f11aa8f35dc40cc69d4d4af7224.tar.bz2
Fix crash when GIT_DIR is invalid
We used to test if a pointer was NULL, and if it was, try to access it. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup.c b/setup.c
index 358e139..2afdba4 100644
--- a/setup.c
+++ b/setup.c
@@ -184,7 +184,7 @@ const char *setup_git_directory_gently(int *nongit_ok)
}
return NULL;
bad_dir_environ:
- if (!nongit_ok) {
+ if (nongit_ok) {
*nongit_ok = 1;
return NULL;
}