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

[PATCH] git_config: access() returns 0 on success, not > 0

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jun 20, 2006, 07:51 UTC
Message-ID
<Pine.LNX.4.63.0606200950460.26329@wbgn013.biozentrum.uni-wuerzburg.de>
Another late-night bug. Sorry again.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
---
 config.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config.c b/config.c
index d064f42..3e077d4 100644
--- a/config.c
+++ b/config.c
@@ -335,7 +335,7 @@ int git_config(config_fn_t fn)
 
 	if (home) {
 		char *user_config = strdup(mkpath("%s/.gitconfig", home));
-		if (access(user_config, R_OK) > 0)
+		if (!access(user_config, R_OK))
 			ret = git_config_from_file(fn, user_config);
 		free(user_config);
 	}
-- 
1.4.0.g59268-dirty
Message 1 of 1 in “git_config: access() returns 0 on success, not > 0”
  1. git_config: access() returns 0 on success, not > 0Johannes Schindelin, Jun 20, 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.