git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix crash when GIT_DIR is invalid

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Aug 4, 2006, 15:46 UTC
Message-ID
<Pine.LNX.4.63.0608041745500.1800@wbgn013.biozentrum.uni-wuerzburg.de>
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>
---
 setup.c |    2 +-
 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(i
 		}
 		return NULL;
 	bad_dir_environ:
-		if (!nongit_ok) {
+		if (nongit_ok) {
 			*nongit_ok = 1;
 			return NULL;
 		}
-- 
1.4.2.rc2.g0bca-dirty
Next: Junio C Hamano
Message 1 of 3 in “Fix crash when GIT_DIR is invalid”
  1. Fix crash when GIT_DIR is invalidJohannes Schindelin, Aug 4, 2006
  2. Junio C HamanoAug 4, 2006
  3. Johannes SchindelinAug 4, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.