threads / patch / 4583

patchgit_config: access() returns 0 on success, not > 0

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

## tl;dr

One message between Jun 20, 2006 and Jun 20, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Johannes Schindelin· Jun 20, 2006, 07:51 UTC · lore
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(-)
Show changes to config.c +1 −1
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

← back to recent threads