summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-09-22 20:44:30 +0300
committerVicent Marti <tanoku@gmail.com>2011-09-27 14:33:18 +0200
commit01d7fded1b233b6a8fcfeec4eaf00b7dc9cc7316 (patch)
tree7c830440f1da196e41a53f1056ee3d2dd197d352 /src/config.c
parentea4dad8ec4388a155836b6427afd018f8432af9d (diff)
downloadlibgit2-01d7fded1b233b6a8fcfeec4eaf00b7dc9cc7316.tar.gz
Revert "Rewrite getenv to use Win32 version on Windows"
This reverts commit e1b86444676b70154bf8ab450d429bdef57a8276.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/config.c b/src/config.c
index e34acba9a..0ec710036 100644
--- a/src/config.c
+++ b/src/config.c
@@ -312,24 +312,20 @@ int git_config_get_string(git_config *cfg, const char *name, const char **out)
int git_config_find_global(char *global_config_path)
{
- char *home;
+ const char *home;
- home = p_getenv("HOME");
+ home = getenv("HOME");
#ifdef GIT_WIN32
if (home == NULL)
- home = p_getenv("USERPROFILE");
+ home = getenv("USERPROFILE");
#endif
- if (home == NULL) {
- free(home);
+ if (home == NULL)
return git__throw(GIT_EOSERR, "Failed to open global config file. Cannot locate the user's home directory");
- }
git_path_join(global_config_path, home, GIT_CONFIG_FILENAME);
- free(home);
-
if (git_futils_exists(global_config_path) < GIT_SUCCESS)
return git__throw(GIT_EOSERR, "Failed to open global config file. The file does not exist");