From: Johannes Schindelin Date: Fri, 4 Aug 2006 15:46:19 +0000 (+0200) Subject: Fix crash when GIT_DIR is invalid X-Git-Tag: v1.4.2-rc4~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3a3c3fc42a021f11aa8f35dc40cc69d4d4af7224;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/setup.c b/setup.c index 358e139d8..2afdba414 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; }