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>
This commit is contained in:
Johannes Schindelin 2006-08-04 17:46:19 +02:00 committed by Junio C Hamano
parent 7e18e56920
commit 3a3c3fc42a

View file

@ -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;
}